Skip to content

Commit

Permalink
test: optimize test files lookup
Browse files Browse the repository at this point in the history
If you use nix flakes and enabling it using direnv, there will be
`.devenv` and `.direnv` directories in your root project directory. By
default vitest will try to look for test files in all directories unless
it is being excluded. Unfortunately `.devenv` and `.direnv` is not on
that list.

All we need is just tell vitest only to look for in `tests` directory.
  • Loading branch information
zackad committed Aug 8, 2024
1 parent ad2e2aa commit a794b9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## unreleased

### Internals
- Optimize test runner by defining where to look for test files

---
## 0.7.0 (2024-08-01)

Expand Down
1 change: 1 addition & 0 deletions vitest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default defineConfig({
}
},
test: {
dir: "tests",
setupFiles: ["./tests_config/run_spec.js"],
snapshotSerializers: ["./tests_config/raw-serializer.js"],
testRegex: "jsfmt\\.spec\\.js$|__tests__/.*\\.js$"
Expand Down

0 comments on commit a794b9d

Please sign in to comment.