chore: upgrade vitest 3.2.4 → 4.0.18
All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 18m42s

Breaking changes addressed:
- vi.fn() mock factories: arrow → regular functions for constructor support
- Exclude dist/ from test resolution (vitest 4 simplified defaults)
- 672 tests pass, 0 tsc errors
This commit is contained in:
OpenClaw 2026-03-12 11:21:03 +01:00
parent 7fffd404e9
commit 55172856b1
5 changed files with 116 additions and 348 deletions

View file

@ -26,7 +26,7 @@ vi.mock("stripe", () => {
retrieve: vi.fn(),
},
};
return { default: vi.fn(() => mockStripe), __mockStripe: mockStripe };
return { default: vi.fn(function() { return mockStripe; }), __mockStripe: mockStripe };
});
let app: express.Express;

View file

@ -6,10 +6,12 @@ const mockQuery = vi.fn();
const mockConnect = vi.fn();
vi.mock("pg", () => {
const Pool = vi.fn(() => ({
connect: mockConnect,
on: vi.fn(),
}));
const Pool = vi.fn(function() {
return {
connect: mockConnect,
on: vi.fn(),
};
});
return { default: { Pool }, Pool };
});