Skip to content

Commit

Permalink
initial integration of Vitest for unit tests (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfishel18 authored Jun 26, 2024
1 parent 5e08b5f commit f01452d
Show file tree
Hide file tree
Showing 4 changed files with 754 additions and 199 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,23 @@ Lints the codebase at `src/`
Formats the code

`npm run format`

## Testing

### VITEST

Runs all unit tests under `src/`. The convention is to create a `.test.js` file in the same directory as the code under test (e.g. `src/helpers/equations.test.js` for `src/helpers/equations.js`).

To run all tests in "watch mode" where tests are re-run when a file is changed:

`npm run test`

Additional options can be passed to the Vitest command ([docs](https://vitest.dev/guide/cli.html#options)), e.g.

```bash
# only run tests for a specific file or directory
npm run test -- src/helpers/equations.test.js

# disable watch mode
npm run test -- --run
```
Loading

0 comments on commit f01452d

Please sign in to comment.