Skip to content

Commit

Permalink
use correct env path in e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmortar committed Aug 9, 2024
1 parent 98ac1bd commit 3f839ee
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/setup-app.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ZodValidationPipe } from '@anatine/zod-nestjs';
import { AppModule } from '@core/app.module';
import { Config } from '@core/config/app';
import opts, { Config } from '@core/config/app';

import { HtmxInterceptor } from '@core/htmx/htmx.interceptor';
import { ZodFilter } from '@core/zod/zod.filter';
import { I18nTranslations } from '@generated/i18n';
import { ValidationPipe } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { Test } from '@nestjs/testing';

import { I18nService } from 'nestjs-i18n';
Expand All @@ -15,7 +15,10 @@ import { Logger } from 'nestjs-pino';
export async function setupApp() {
const moduleFixture = await Test.createTestingModule({
imports: [AppModule],
}).compile();
})
.overrideModule(ConfigModule)
.useModule(ConfigModule.forRoot({ ...opts, envFilePath: '.env.test' }))
.compile();

const app = moduleFixture.createNestApplication();
const logger = app.get(Logger);
Expand Down

0 comments on commit 3f839ee

Please sign in to comment.