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:
@@ -55,6 +55,12 @@ bun run build
|
||||
# Run unit/component tests
|
||||
bun test
|
||||
|
||||
# Run unit tests only
|
||||
bun run test:unit
|
||||
|
||||
# Run component tests only
|
||||
bun run test:component
|
||||
|
||||
# Run acceptance tests (Playwright)
|
||||
bun run test:acceptance
|
||||
|
||||
@@ -62,7 +68,7 @@ bun run test:acceptance
|
||||
bun run lint
|
||||
```
|
||||
|
||||
**Note**: E2E tests still use Playwright, as Bun's test runner doesn't support browser automation. Unit and component tests have been migrated to Bun's native test runner for faster execution.
|
||||
**Note**: E2E tests still use Playwright, as Bun's test runner doesn't support browser automation. Unit and component tests have been migrated to Bun's native test runner for faster execution. E2E tests are located in the `e2e/` directory (not `src/__tests__/e2e/`).
|
||||
|
||||
### CI/CD with Bun
|
||||
|
||||
|
||||
Reference in New Issue
Block a user