Skip to content

Testing locally

gaslamp includes a comprehensive test suite covering all major functionality:

Bash
npm test
# or
task test
  • Runs unit tests using Vitest (ESM-native, no compilation step required).
  • Test files (*.test.ts) are located in __tests__/.
  • Vitest settings are configured in vitest.config.ts.

Test individually

Bash
npm test -- __tests__/filename.test.ts

Test coverage

Bash
npm run test:coverage
  • Generates a coverage report in the terminal.
  • Also generates HTML reports under coverage/lcov-report/, which you can open in a browser.

Watch mode for development

Bash
npm run test:watch

References

  • vitest.config.ts — Vitest configuration
  • package.json — npm scripts