refactor: improve test structure for Bun compatibility
- Update all test files to use named mock variables instead of inline mocks - Clear mock history in beforeEach instead of using mock.restore() - Add default mock implementations stored at module level - Document that tests should not use --randomize flag due to mock.module() limitations - All 89 unit tests pass consistently without randomization
This commit is contained in:
+8
-4
@@ -7,10 +7,14 @@
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "bun run eslint",
|
||||
"test": "bun test",
|
||||
"test:run": "bun test",
|
||||
"test:acceptance": "bun x playwright test src/__tests__/e2e/",
|
||||
"test:acceptance:headed": "bun x playwright test src/__tests__/e2e/ --headed",
|
||||
"test": "bun test 'src/__tests__/unit/**' 'src/__tests__/*.test.tsx' 'src/__tests__/auth-simple.test.ts'",
|
||||
"test:unit": "bun test src/__tests__/unit/",
|
||||
"test:component": "bun test src/__tests__/*.test.tsx",
|
||||
"test:run": "bun test 'src/__tests__/unit/**' 'src/__tests__/*.test.tsx' 'src/__tests__/auth-simple.test.ts'",
|
||||
"test:randomize": "bun test src/__tests__/unit/ --randomize",
|
||||
"test:unit:sequential": "bun test src/__tests__/unit/ --max-concurrency=1",
|
||||
"test:acceptance": "bun x playwright test e2e/",
|
||||
"test:acceptance:headed": "bun x playwright test e2e/ --headed",
|
||||
"db:switch": "bun run scripts/switch-database.js",
|
||||
"db:setup-postgres": "bun run scripts/setup-postgres.js",
|
||||
"db:setup-dev": "bun run scripts/setup-postgres.js",
|
||||
|
||||
Reference in New Issue
Block a user