Skip to content

Commit 1bbb8c8

Browse files
committed
feat(core): support NestJS 11
BREAKING CHANGE: The default mount point for express middleware has been changed from '*' to '/'
1 parent 5cf6b5c commit 1bbb8c8

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

packages/core/src/lib/cls.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class ClsModule implements NestModule {
7070

7171
const options = this.moduleRef.get(CLS_MIDDLEWARE_OPTIONS);
7272
const adapter = this.adapterHost.httpAdapter;
73-
let mountPoint = '*';
73+
let mountPoint = '/';
7474
if (adapter.constructor.name === 'FastifyAdapter') {
7575
mountPoint = '(.*)';
7676
}

packages/core/test/rest/http-express.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe('Http Express App - Manually bound Middleware in AppModule', () => {
7777
})
7878
class TestAppWithManuallyBoundMiddleware implements NestModule {
7979
configure(consumer: MiddlewareConsumer) {
80-
consumer.apply(ClsMiddleware).forRoutes('*');
80+
consumer.apply(ClsMiddleware).forRoutes('/');
8181
}
8282
}
8383

@@ -106,7 +106,7 @@ describe('Http Express App - Manually bound Middleware in AppModule + global pre
106106
})
107107
class TestAppWithManuallyBoundMiddleware implements NestModule {
108108
configure(consumer: MiddlewareConsumer) {
109-
consumer.apply(ClsMiddleware).forRoutes('*');
109+
consumer.apply(ClsMiddleware).forRoutes('/');
110110
}
111111
}
112112

packages/core/test/websockets/expect-ids-websockets.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { INestApplication } from '@nestjs/common';
2-
import request from 'superwstest';
2+
import request, { WSChain } from 'superwstest';
33

44
export const expectOkIdsWs =
55
(path = '', event = 'hello', data = {}) =>
6-
async (app: INestApplication) =>
6+
async (app: INestApplication): Promise<WSChain> =>
77
request(await app.getUrl())
88
.ws(path)
99
.sendJson({
@@ -22,8 +22,8 @@ export const expectOkIdsWs =
2222

2323
export const expectErrorIdsWs =
2424
(path = '', event = 'error', data = {}) =>
25-
(app: INestApplication) =>
26-
request(app.getHttpServer())
25+
async (app: INestApplication): Promise<WSChain> =>
26+
request(await app.getUrl())
2727
.ws(path)
2828
.sendJson({
2929
event,

0 commit comments

Comments
 (0)