How do you test a NestJS `CanActivate` guard in isolation?
-
A
Mount it in an e2e test and check the HTTP response status
-
B
Instantiate the guard directly and call its `canActivate()` method with a mock `ExecutionContext`
-
C
Use `app.useGlobalGuards()` inside the test module
-
D
Decorate the test controller with `@UseGuards()` and verify route access