Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup: test
  • Loading branch information
ronag committed Mar 19, 2020
commit 0d9b733ca1a9280b1699fb1fc5d5ecd992d53919
12 changes: 4 additions & 8 deletions test/parallel/test-async-hooks-http-parser-destroy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
require('../common');
const common = require('../common');
const assert = require('assert');
const async_hooks = require('async_hooks');
const http = require('http');
Expand Down Expand Up @@ -45,13 +45,9 @@ async_hooks.createHook({
}).enable();

const server = http.createServer((req, res) => {
let closed = false;
req.on('close', () => {
closed = true;
});
req.on('readable', () => {
assert.strictEqual(closed, false);
});
req.on('close', common.mustCall(() => {
req.on('readable', common.mustNotCall());
}));
res.end('Hello');
});

Expand Down
7 changes: 1 addition & 6 deletions test/parallel/test-http-no-read-no-dump.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';
const common = require('../common');
const http = require('http');
const assert = require('assert');

let onPause = null;

Expand All @@ -12,12 +11,8 @@ const server = http.createServer((req, res) => {
res.writeHead(200);
res.flushHeaders();

let closed = false;
req.on('close', common.mustCall(() => {
closed = true;
}));
req.on('end', common.mustCall(() => {
assert.strictEqual(closed, false);
req.on('end', common.mustNotCall());
}));

req.connection.on('pause', () => {
Expand Down