fix(core): prevent exclude method from overwriting previous calls

This commit is contained in:
dragontaek-lee
2024-05-25 23:07:44 +09:00
parent aa7538ffbe
commit 4d88c79839
2 changed files with 17 additions and 5 deletions

View File

@@ -45,6 +45,11 @@ class TestController {
overviewById() {
return RETURN_VALUE;
}
@Get('multiple/exclude')
multipleExclude() {
return RETURN_VALUE;
}
}
@Module({
@@ -59,6 +64,7 @@ class TestModule {
path: 'middleware',
method: RequestMethod.POST,
})
.exclude('multiple/exclude')
.forRoutes('*');
}
}
@@ -110,6 +116,12 @@ describe('Exclude middleware', () => {
.expect(200, RETURN_VALUE);
});
it(`should exclude "/multiple/exclude" endpoint`, () => {
return request(app.getHttpServer())
.get('/multiple/exclude')
.expect(200, RETURN_VALUE);
});
afterEach(async () => {
await app.close();
});