Skip to content

Commit 9e9c52b

Browse files
Merge pull request #44 from github-samples/dependabot/npm_and_yarn/vitest/ui-4.0.13
Bump @vitest/ui from 3.2.4 to 4.0.13
2 parents ede4159 + 7116e07 commit 9e9c52b

File tree

11 files changed

+156
-287
lines changed

11 files changed

+156
-287
lines changed

mcp-server/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
},
2424
"devDependencies": {
2525
"@eslint/js": "^9.39.1",
26-
"@vitest/ui": "^3.2.4",
26+
"@vitest/ui": "^4.0.14",
2727
"typescript": "^5.9.3",
2828
"typescript-eslint": "^8.48.0",
29-
"vitest": "^3.2.4"
29+
"vitest": "^4.0.14"
3030
}
3131
}

mcp-server/src/integration/integration.test.ts

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,36 @@ vi.mock('../utils/http-client.js', () => ({
1919
}))
2020

2121
// Mock only the game classes from shared library
22+
// In vitest v4, mocks used as constructors must use 'function' syntax
2223
vi.mock('@turn-based-mcp/shared', async (importOriginal) => {
2324
const actual = await importOriginal() as any
2425
return {
2526
...actual,
26-
TicTacToeGame: vi.fn(() => ({
27-
getValidMoves: vi.fn(() => [{ row: 0, col: 0 }])
28-
})),
29-
RockPaperScissorsGame: vi.fn(() => ({}))
27+
TicTacToeGame: vi.fn(function() {
28+
return {
29+
getValidMoves: vi.fn(() => [{ row: 0, col: 0 }])
30+
}
31+
}),
32+
RockPaperScissorsGame: vi.fn(function() { return {} })
3033
}
3134
})
3235

3336
// Mock AI modules
37+
// In vitest v4, mocks used as constructors must use 'function' syntax
3438
vi.mock('../ai/tic-tac-toe-ai.js', () => ({
35-
TicTacToeAI: vi.fn(() => ({
36-
makeMove: vi.fn(() => ({ row: 0, col: 0 }))
37-
}))
39+
TicTacToeAI: vi.fn(function() {
40+
return {
41+
makeMove: vi.fn(() => ({ row: 0, col: 0 }))
42+
}
43+
})
3844
}))
3945

4046
vi.mock('../ai/rock-paper-scissors-ai.js', () => ({
41-
RockPaperScissorsAI: vi.fn(() => ({
42-
makeChoice: vi.fn(() => 'rock')
43-
}))
47+
RockPaperScissorsAI: vi.fn(function() {
48+
return {
49+
makeChoice: vi.fn(() => 'rock')
50+
}
51+
})
4452
}))
4553

4654
describe('MCP Server Integration', () => {

0 commit comments

Comments
 (0)