This program is a proof of concept of the test for decorator in NestJs 7.
This program implement the authentication technique and implement a unit test for the user logged.
npm i
npm start
For the test is used the package node-mocks-http
and the use of decorator:
const req = httpMock.createRequest();
const res = httpMock.createResponse();
const ctx = new ExecutionContextHost([req, res], AppController, appController.Get);
const factory = getParamDecoratorFactory(User);
For launch:
npm run test
npm run test:e2e