mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
fix(core): fix middleware for versioned routes
fix middlewares for versioned routes using media type as versioning type
This commit is contained in:
@@ -50,7 +50,7 @@ describe('Middleware', () => {
|
||||
app = await createAppWithVersioningType(VersioningType.URI);
|
||||
});
|
||||
|
||||
it(`forRoutes({ path: ';versioned', version: '1', method: RequestMethod.ALL })`, () => {
|
||||
it(`forRoutes({ path: '/versioned', version: '1', method: RequestMethod.ALL })`, () => {
|
||||
return request(app.getHttpServer())
|
||||
.get('/v1/versioned')
|
||||
.expect(200, VERSIONED_VALUE);
|
||||
@@ -62,7 +62,19 @@ describe('Middleware', () => {
|
||||
app = await createAppWithVersioningType(VersioningType.HEADER);
|
||||
});
|
||||
|
||||
it(`forRoutes({ path: 'tests/versioned', version: '1', method: RequestMethod.ALL })`, () => {
|
||||
it(`forRoutes({ path: '/versioned', version: '1', method: RequestMethod.ALL })`, () => {
|
||||
return request(app.getHttpServer())
|
||||
.get('/versioned')
|
||||
.expect(200, VERSIONED_VALUE);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when using MEDIA TYPE versioning', () => {
|
||||
beforeEach(async () => {
|
||||
app = await createAppWithVersioningType(VersioningType.MEDIA_TYPE);
|
||||
});
|
||||
|
||||
it(`forRoutes({ path: '/versioned', version: '1', method: RequestMethod.ALL })`, () => {
|
||||
return request(app.getHttpServer())
|
||||
.get('/versioned')
|
||||
.expect(200, VERSIONED_VALUE);
|
||||
|
||||
Reference in New Issue
Block a user