eugef / node-mocks-http

Mock 'http' objects for testing Express routing functions
Other
753 stars 133 forks source link

req.resume is not a function at send #184

Closed crazy4groovy closed 4 years ago

crazy4groovy commented 5 years ago

Has anyone seen this error before? I am not certain what is causing it in my call stack

(node:16) UnhandledPromiseRejectionWarning: TypeError: req.resume is not a function
at send (/usr/app/node_modules/finalhandler/index.js:310:7)
at /usr/app/node_modules/finalhandler/index.js:133:5
at /usr/app/node_modules/express/lib/router/index.js:635:15
at next (/usr/app/node_modules/express/lib/router/index.js:210:14)
at Function.handle (/usr/app/node_modules/express/lib/router/index.js:174:3)
at Function.handle (/usr/app/node_modules/express/lib/application.js:174:10)
at app (/usr/app/node_modules/express/lib/express.js:39:9)
at /usr/app/dist/fargate-nest.js:28:9

I am using NestJS, which should be express-compatible. Here is my calling code.

  const req = httpMocks.createRequest({method: 'GET'});
  const res = httpMocks.createResponse();
  // execute NestJS App
  expressApp(req, res);
AndyOGo commented 5 years ago

@crazy4groovy a quick search for resume does not show an available req.resume function: Express: https://github.com/expressjs/express/search?q=resume&unscoped_q=resume

Nest: https://github.com/nestjs/nest/search?q=resume&unscoped_q=resume

github-actions[bot] commented 4 years ago

Stale issue message