Skip to content

Commit 52e14b0

Browse files
committed
feat(core): address review comments
1 parent 47f05de commit 52e14b0

2 files changed

Lines changed: 24 additions & 6 deletions

File tree

integration/nest-application/global-prefix/e2e/global-prefix.spec.ts

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('Global prefix', () => {
1515
app = module.createNestApplication();
1616
});
1717

18-
it.only(`should use the global prefix`, async () => {
18+
it(`should use the global prefix`, async () => {
1919
app.setGlobalPrefix('/api/v1')
2020

2121
server = app.getHttpServer();
@@ -30,7 +30,7 @@ describe('Global prefix', () => {
3030
.expect(200)
3131
});
3232

33-
it.only(`should exclude the path as string`, async () => {
33+
it(`should exclude the path as string`, async () => {
3434
app.setGlobalPrefix('/api/v1', {exclude: ['/test']})
3535

3636
server = app.getHttpServer();
@@ -51,7 +51,7 @@ describe('Global prefix', () => {
5151
.expect(404)
5252
});
5353

54-
it.only(`should exclude the path as RouteInfo`, async () => {
54+
it(`should exclude the path as RouteInfo`, async () => {
5555
app.setGlobalPrefix('/api/v1', {exclude: [{path: '/health', method: RequestMethod.GET}]})
5656

5757
server = app.getHttpServer();
@@ -66,7 +66,26 @@ describe('Global prefix', () => {
6666
.expect(404)
6767
});
6868

69-
it.only(`should exclude the path as a mix of string and RouteInfo`, async () => {
69+
it(`should only exclude the GET RequestMethod`, async () => {
70+
app.setGlobalPrefix('/api/v1', {exclude: [{path: '/test', method: RequestMethod.GET}]})
71+
72+
server = app.getHttpServer();
73+
await app.init();
74+
75+
await request(server)
76+
.get('/test')
77+
.expect(200)
78+
79+
await request(server)
80+
.post('/test')
81+
.expect(404)
82+
83+
await request(server)
84+
.post('/api/v1/test')
85+
.expect(201)
86+
});
87+
88+
it(`should exclude the path as a mix of string and RouteInfo`, async () => {
7089
app.setGlobalPrefix('/api/v1', {exclude: ["test", {path: '/health', method: RequestMethod.GET}]})
7190

7291
server = app.getHttpServer();
@@ -81,7 +100,7 @@ describe('Global prefix', () => {
81100
.expect(200)
82101
});
83102

84-
it.only(`should exclude the path with route param`, async () => {
103+
it(`should exclude the path with route param`, async () => {
85104
app.setGlobalPrefix('/api/v1', {exclude: ['/hello/:name']})
86105

87106
server = app.getHttpServer();

packages/core/router/router-explorer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ export class RouterExplorer {
252252
return false;
253253
}
254254
if (
255-
route.method &&
256255
route.method !== RequestMethod.ALL &&
257256
route.method !== requestMethod
258257
) {

0 commit comments

Comments
 (0)