8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3e76e7 commit 91d5416Copy full SHA for 91d5416
test/parallel/test-http-status-reason-invalid-chars.js
@@ -3,6 +3,7 @@
3
const common = require('../common');
4
const assert = require('assert');
5
const http = require('http');
6
+const Countdown = require('../common/countdown');
7
8
function explicit(req, res) {
9
assert.throws(() => {
@@ -34,13 +35,12 @@ const server = http.createServer((req, res) => {
34
35
}
36
}).listen(0, common.mustCall(() => {
37
const hostname = 'localhost';
38
+ const countdown = new Countdown(2, () => server.close());
39
const url = `http://${hostname}:${server.address().port}`;
- let left = 2;
40
const check = common.mustCall((res) => {
- left--;
41
assert.notStrictEqual(res.headers['content-type'], 'text/html');
42
assert.notStrictEqual(res.headers['content-type'], 'gotcha');
43
- if (left === 0) server.close();
+ countdown.dec();
44
}, 2);
45
http.get(`${url}/explicit`, check).end();
46
http.get(`${url}/implicit`, check).end();