Skip to content

Commit e70f49f

Browse files
committed
fix-tests
1 parent bc7dfe9 commit e70f49f

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/_internal/resource-path.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { join, dirname } from "node:path"
22
import { readFileSync, existsSync } from "node:fs"
3+
import { fileURLToPath } from "node:url"
34

45
const DIST_RESOURCES_DIR = "resources"
56

@@ -21,7 +22,7 @@ function findProjectRoot(startDir: string): string {
2122
}
2223

2324
function getResourcesRoot(): string {
24-
const currentDir = __dirname
25+
const currentDir = dirname(fileURLToPath(import.meta.url))
2526

2627
if (currentDir.includes("/dist/")) {
2728
const distIndex = currentDir.lastIndexOf("/dist/")

test/e2e/mcp-registration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ vi.setConfig({ testTimeout: 600000, hookTimeout: 60000 })
1010
const __filename = fileURLToPath(import.meta.url)
1111
const __dirname = dirname(__filename)
1212
const REPO_ROOT = join(__dirname, '../..')
13-
const MCP_SERVER_PATH = join(REPO_ROOT, 'dist/stdio.js')
13+
const MCP_SERVER_PATH = join(REPO_ROOT, 'dist/index.js')
1414

1515
interface MCPRequest {
1616
jsonrpc: '2.0'
@@ -295,7 +295,7 @@ describe('MCP Server Registration', () => {
295295
method: 'tools/call',
296296
params: {
297297
name: 'nextjs_docs',
298-
arguments: { query: 'cache' },
298+
arguments: { action: 'search', query: 'cache' },
299299
},
300300
})
301301

test/e2e/upgrade.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { execSync } from 'child_process'
66
import { fileURLToPath } from 'url'
77
import { query } from '@anthropic-ai/claude-agent-sdk'
88
import { config } from 'dotenv'
9-
import upgradeNextjs16Prompt from '../../src/prompts/upgrade-nextjs-16'
9+
import { handler as upgradeNextjs16Prompt } from '../../src/prompts/upgrade-nextjs-16.js'
1010

1111
config({ path: join(dirname(fileURLToPath(import.meta.url)), '.env') })
1212

test/prompts/prompts.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { describe, it, expect } from 'vitest'
22
import { execSync } from 'child_process'
33
import { join } from 'path'
4-
import getEnableCacheComponentsPrompt from '../../src/prompts/enable-cache-components'
5-
import getUpgradeNextjs16Prompt from '../../src/prompts/upgrade-nextjs-16'
4+
import { handler as getEnableCacheComponentsPrompt } from '../../src/prompts/enable-cache-components.js'
5+
import { handler as getUpgradeNextjs16Prompt } from '../../src/prompts/upgrade-nextjs-16.js'
66

77
const REPO_ROOT = join(__dirname, '../..')
88
const CHARS_PER_TOKEN = 4

0 commit comments

Comments
 (0)