Testing Commands
Testing Commands
Info
This document covers the testing commands for running, filtering, and measuring test coverage in the eIsland frontend.
All commands are run from the web/ directory:
cd web
npm run <script>npm run test
Runs the full test suite once.
npm run testConfiguration: Vitest with:
environment: 'node'clearMocks: true— mocks are cleared between testsrestoreMocks: true— mocks are restored to their original implementation- Test file pattern:
src/**/*.test.ts
Tips
For iterative development, use npx vitest (without run) to start Vitest in watch mode — it re-runs affected tests on file save.
When to use:
- Before committing code
- In CI pipelines
- After pulling new changes to verify nothing is broken
npm run test:preload
Runs only the preload bridge test file.
npm run test:preloadUnder the hood: vitest run src/preload/index.test.ts
Note
This is a subset of npm run test. Use it when modifying preload code for faster feedback — it skips all other test files.
npm run test:coverage
Runs the full test suite with an Istanbul coverage report.
npm run test:coverageOutput: Coverage report in the terminal and coverage/ directory with HTML reports.
When to use:
- Before opening a PR to verify coverage thresholds
- Periodically to audit test gaps
- When adding new features to ensure they are tested
Troubleshooting
npm run test Fails After Pull
Stale build artifacts:
rm -rf out/ node_modules/
npm install
npm run testChangelog
4f6b6-on

