-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
needs triageThis issue has not been looked intoThis issue has not been looked into
Description
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
Hello,
Overriding a guard with the method below doesn't actually override the guard.
testingModule
.overrideGuard(MyGuard)
.useValue({ canActivate: () => true })
.compile();
Minimum reproduction code
https://github.com/juliengbt/nestjs-guard-override
Steps to reproduce
- npm install
- npm run test:e2e
Expected behavior
test should not fail because the guard should be overridden
Package
- I don't know. Or some 3rd-party package
-
@nestjs/common
-
@nestjs/core
-
@nestjs/microservices
-
@nestjs/platform-express
-
@nestjs/platform-fastify
-
@nestjs/platform-socket.io
-
@nestjs/platform-ws
-
@nestjs/testing
-
@nestjs/websockets
- Other (see below)
Other package
No response
NestJS version
9.0.0
Packages versions
"dependencies": {
"@nestjs/common": "^9.0.0",
"@nestjs/core": "^9.0.0",
"@nestjs/passport": "^9.0.0",
"@nestjs/platform-express": "^9.0.0",
"@nestjs/platform-fastify": "^9.1.3",
"passport": "^0.6.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.2.0"
}
Node.js version
16.14.0
In which operating systems have you tested?
- macOS
- Windows
- Linux
Other
No response
Metadata
Metadata
Assignees
Labels
needs triageThis issue has not been looked intoThis issue has not been looked into