Skip to content

Commit f33084f

Browse files
committed
test(apps): Fixed env variables not being stubbed during tests
1 parent fc32102 commit f33084f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

apps/nest/tests/vitest.setup.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { vi } from 'vitest';
2+
3+
vi.stubEnv('AUTH_CLIENT_SECRET', crypto.randomUUID());
4+
vi.stubEnv('AUTH_COOKIE_SECRET', crypto.randomUUID());

apps/nest/vite.config.mts

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export default defineConfig({
4343
test: {
4444
environment: 'node',
4545
silent: true,
46+
setupFiles: './tests/vitest.setup.ts',
4647
reporters: ['default', 'junit'],
4748
outputFile: 'reports/junit/junit.xml',
4849
coverage: {

0 commit comments

Comments
 (0)