Skip to content

Commit

Permalink
chore: switch package /base to use vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
work-kevin-flynn committed Nov 26, 2024
1 parent 8788f2e commit 99d31e6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 190 deletions.
187 changes: 0 additions & 187 deletions packages/base/jest.config.ts

This file was deleted.

6 changes: 4 additions & 2 deletions packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
"scripts": {
"dev": "father dev",
"build": "father build",
"test": "jest --config=jest.config.ts --detectOpenHandles",
"test:coverage": "jest --config=jest.config.ts --coverage --detectOpenHandles"
"test": "vitest",
"test:dev": "pnpm test -- --watch",
"test:coverage": "pnpm test -- --coverage",
"test:debug": "pnpm test -- --detectOpenHandles"
},
"dependencies": {
"eventemitter3": "^5.0.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const originalConsoleLog = console.log;

describe('localStorageMock in window', () => {
beforeEach(() => {
console.log = jest.fn();
console.log = vi.fn();
(global as any).window = {};
});
afterEach(() => {
Expand Down
4 changes: 4 additions & 0 deletions packages/base/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import baseViteConfig from '../tools/vite.config';
import { mergeConfig } from 'vitest/config';

export default mergeConfig(baseViteConfig, {});
2 changes: 2 additions & 0 deletions packages/base/vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import '../tools/__mocks__/setupGlobal';
import '../tools/__mocks__/setupLocal';

0 comments on commit 99d31e6

Please sign in to comment.