Skip to content

Commit 9c0d592

Browse files
committed
fix(test): configure test environments to load .env variables
1 parent ce6819c commit 9c0d592

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

vitest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ export default defineConfig({
1010
test: {
1111
globals: true,
1212
environment: 'jsdom',
13-
setupFiles: ['@testing-library/jest-dom'],
13+
setupFiles: ['./vitest.setup.ts'],
1414
},
1515
})

wallaby.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
module.exports = function () {
1+
module.exports = function (wallaby) {
22
return {
3-
files: ['src/**/*', 'tests/**/*', '!**/*.test.*'],
3+
files: [
4+
'src/**/*',
5+
'tests/**/*',
6+
'.env',
7+
'vitest.setup.ts',
8+
'!**/*.test.*',
9+
],
410
tests: ['tests/**/*.test.*', 'src/**/*.test.*'],
511

612
// Tell Wallaby it's a Vitest project and to use the Vite config.
@@ -10,6 +16,7 @@ module.exports = function () {
1016
},
1117

1218
setup: (wallaby) => {
19+
require('dotenv').config()
1320
const vitestConfig = require('./vite.config.ts').default.test
1421
wallaby.testFramework.setupFiles = vitestConfig.setupFiles
1522
},

0 commit comments

Comments
 (0)