forwardemail / forwardemail/supertest
Run the first example
- Dominant language
- JavaScript
- Stars
- 14.4k
- Forks
- 782
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to run the first example.
```js
const request = require('supertest');
const express = require('express');
const app = express();
app.get('/user', function(req, res) {
res.status(200).json({ name: 'john' });
});
request(app)
.get('/user')
.expect('Content-Type', /json/)
.expect('Content-Length', '15')
.expect(200)
.end(function(err, res) {
if (err) throw err;
});
```
But, It crashes with an Operation timed out error:
```
Error: ETIMEDOUT: Operation timed out
at Test.assert (G:\Projects\Nodejs\testJest\node_modules\supertest\lib\test.js:200:18)
at Server.localAssert (G:\Projects\Nodejs\testJest\node_modules\supertest\lib\test.js:166:12)
at Object.onceWrapper (events.js:481:28)
at Server.emit (events.js:375:28)
at emitCloseNT (net.js:1661:8)
at processTicksAndRejections (internal/process/task_queues.js:81:21)
```
I using node v14.17.1, and npm v6.14.13.
[My package.json and package-lock.json](https://gist.github.com/zl0i/bb6946f33e7656467156213d20255429)
Contributor guide
Research direction
The stack trace points to node_modules/supertest/lib/test.js:166 and :200; start by running the supplied example with the linked package.json and package-lock.json using the stated Node and npm versions. Confirm whether the timeout is reproducible and trace the request and response assertions until its cause is isolated; done means a focused regression test or a confirmed report with the expected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- express, javascript, node.js
- Domain
- backend, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100