* Update CI workflow, dependencies, and add Vitest for testing Co-authored-by: overtorment <overtorment@gmail.com> * Remove Vitest UI and related configuration Co-authored-by: overtorment <overtorment@gmail.com> * Move string utils tests to dedicated tests directory Co-authored-by: overtorment <overtorment@gmail.com> * Update CI workflow to separate lint and test jobs Co-authored-by: overtorment <overtorment@gmail.com> * Rename vitest.config.ts to vitest.config.mts Co-authored-by: overtorment <overtorment@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
806 B
806 B
Testing
This project uses Vitest for unit testing.
Running Tests
# Run tests once
npm run test:run
# Run tests in watch mode
npm test
Test Structure
Tests are located in the src/tests/ directory with the .test.ts suffix.
Current test coverage includes:
StringUtils- Utility functions for shortening addresses and transaction IDs
GitHub Actions
The CI pipeline runs on every pull request via GitHub Actions with two separate jobs:
Lint Job
- Sets up Node.js 18
- Installs dependencies
- Runs linting (Prettier + TypeScript compilation)
Test Job
- Sets up Node.js 18
- Installs dependencies
- Executes the test suite
Both jobs run in parallel for faster feedback. The workflow file is located at .github/workflows/ci.yml.