Hey folks, couldn't find info on testing custom param decorators.
import { createParamDecorator, ExecutionContext } from '@nestjs/common';
import { AuthenticatedRequest } from './auth.guard';
export const User = createParamDecorator(
(data: unknown, ctx: ExecutionContext) => {
const request = ctx.switchToHttp().getRequest<AuthenticatedRequest>();
return request.user;
},
);
I have a super simple param decorator I'd like to write a test for. Not sure how to do that. If you have other advices/practices along the way I'd much appreciate it, thanks