Skip to content

Commit b8b57df

Browse files
committed
fix: test case
Signed-off-by: Innei <i@innei.in>
1 parent 51358a6 commit b8b57df

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

test/helper/setup-e2e.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { fastifyApp } from '@core/common/adapter/fastify.adapter'
22
import { JSONTransformerInterceptor } from '@core/common/interceptors/json-transformer.interceptor'
33
import { ResponseInterceptor } from '@core/common/interceptors/response.interceptor'
44
import { ZodValidationPipe } from '@core/common/pipes/zod-validation.pipe'
5-
import { LoggerModule } from '@core/processors/logger/logger.module'
6-
import { MyLogger } from '@core/processors/logger/logger.service'
75
import { ModuleMetadata } from '@nestjs/common'
86
import { APP_INTERCEPTOR, APP_PIPE } from '@nestjs/core'
97
import { NestFastifyApplication } from '@nestjs/platform-fastify'
@@ -18,7 +16,6 @@ export const setupE2EApp = async (module: ModuleMetadata) => {
1816
controllers: module.controllers || [],
1917
}
2018

21-
nextModule.imports!.unshift(LoggerModule)
2219
nextModule.providers!.unshift({
2320
provide: APP_PIPE,
2421
useClass: ZodValidationPipe,
@@ -37,7 +34,7 @@ export const setupE2EApp = async (module: ModuleMetadata) => {
3734
)
3835

3936
await app.init()
40-
app.useLogger(app.get(MyLogger))
37+
4138
await app.getHttpAdapter().getInstance().ready()
4239

4340
return app

test/src/modules/post/__snapshots__/post.service.spec.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`/modules/post/post.service > should get post throw when 404 1`] = `"post not found"`;
3+
exports[`/modules/post/post.service > should get post throw when 404 1`] = `[BizException: post not found]`;
44

55
exports[`/modules/post/post.service > should paginate posts successful 1`] = `
66
{
@@ -13,6 +13,6 @@ exports[`/modules/post/post.service > should paginate posts successful 1`] = `
1313
}
1414
`;
1515

16-
exports[`/modules/post/post.service > should throw when category not found 1`] = `"category not found"`;
16+
exports[`/modules/post/post.service > should throw when category not found 1`] = `[BizException: category not found]`;
1717

18-
exports[`/modules/post/post.service > should throw when post exist 1`] = `"post already exist"`;
18+
exports[`/modules/post/post.service > should throw when post exist 1`] = `[BizException: post already exist]`;

0 commit comments

Comments
 (0)