Skip to content

Commit

Permalink
Merge pull request #383 from acelaya-forks/feature/test-workspace
Browse files Browse the repository at this point in the history
Replace deprecated environmentMatchGlobs with workspace in vitest config
  • Loading branch information
acelaya authored Feb 8, 2025
2 parents d36d8c7 + e52274b commit baac58d
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,22 @@ export default defineConfig({
test: {
globals: true,
allowOnly: true,
environmentMatchGlobs: [
['**/*.server.test.{ts|tsx}', 'node'],
['**/*', 'jsdom'],
workspace: [
// Run tests for server-only files in node environment
{
extends: true,
test: {
environment: 'node',
include: ['**/*.server.test.{ts|tsx}'],
},
},
// Run rest of tests in JSDOM environment
{
extends: true,
test: {
environment: 'jsdom',
},
},
],
setupFiles: './test/setup.ts',
dir: 'test',
Expand Down

0 comments on commit baac58d

Please sign in to comment.