Skip to content

Commit 31c9c0b

Browse files
authored
fix: update test mocks for Vitest 4.0 compatibility (#27)
Vitest 4.0 requires mock constructors to use the function keyword instead of arrow functions. Updated mockImplementation calls in: - cloudflare-pages.test.ts - deployment-intelligence.test.ts All 132 tests now pass with Vitest 4.0.4.
1 parent 9225aac commit 31c9c0b

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.6.2] - 2025-11-21
11+
12+
### Fixed
13+
14+
- Updated test mock implementations for Vitest 4.0 compatibility
15+
- Mock constructors now use `function` keyword instead of arrow functions as required by Vitest 4.0
16+
17+
### Changed
18+
19+
- Upgraded to Vitest 4.0.4 from 3.2.4
20+
- Updated all development dependencies to latest versions
21+
1022
## [0.1.0] - 2025-01-15
1123

1224
### Added

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "deploy-mcp",
3-
"version": "0.6.1",
3+
"version": "0.6.2",
44
"description": "Universal deployment tracker for AI assistants",
55
"keywords": [
66
"mcp",

src/adapters/cloudflare-pages/__tests__/cloudflare-pages.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ describe("CloudflarePagesAdapter", () => {
2323
};
2424

2525
// Mock the API constructor
26-
vi.mocked(CloudflarePagesAPI).mockImplementation(() => mockAPI);
26+
vi.mocked(CloudflarePagesAPI).mockImplementation(function () {
27+
return mockAPI;
28+
});
2729
});
2830

2931
describe("constructor", () => {

src/core/__tests__/deployment-intelligence.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ describe("DeploymentIntelligence", () => {
1515
getRecentDeployments: vi.fn(),
1616
getDeploymentLogs: vi.fn(),
1717
};
18-
(VercelAdapter as any).mockImplementation(() => mockAdapter);
18+
(VercelAdapter as any).mockImplementation(function () {
19+
return mockAdapter;
20+
});
1921
intelligence = new DeploymentIntelligence("vercel");
2022
});
2123

0 commit comments

Comments
 (0)