diff options
Diffstat (limited to 'test/parallel/test-stream-duplex-destroy.js')
-rw-r--r-- | test/parallel/test-stream-duplex-destroy.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/parallel/test-stream-duplex-destroy.js b/test/parallel/test-stream-duplex-destroy.js index 00e334d64b..854d29ffc1 100644 --- a/test/parallel/test-stream-duplex-destroy.js +++ b/test/parallel/test-stream-duplex-destroy.js @@ -13,8 +13,9 @@ const { inherits } = require('util'); duplex.resume(); - duplex.on('end', common.mustCall()); - duplex.on('finish', common.mustCall()); + duplex.on('end', common.mustNotCall()); + duplex.on('finish', common.mustNotCall()); + duplex.on('close', common.mustCall()); duplex.destroy(); assert.strictEqual(duplex.destroyed, true); @@ -29,8 +30,8 @@ const { inherits } = require('util'); const expected = new Error('kaboom'); - duplex.on('end', common.mustCall()); - duplex.on('finish', common.mustCall()); + duplex.on('end', common.mustNotCall()); + duplex.on('finish', common.mustNotCall()); duplex.on('error', common.mustCall((err) => { assert.strictEqual(err, expected); })); @@ -78,6 +79,7 @@ const { inherits } = require('util'); // error is swallowed by the custom _destroy duplex.on('error', common.mustNotCall('no error event')); + duplex.on('close', common.mustCall()); duplex.destroy(expected); assert.strictEqual(duplex.destroyed, true); @@ -159,8 +161,8 @@ const { inherits } = require('util'); }); duplex.resume(); - duplex.on('finish', common.mustCall()); - duplex.on('end', common.mustCall()); + duplex.on('finish', common.mustNotCall()); + duplex.on('end', common.mustNotCall()); duplex.destroy(); assert.strictEqual(duplex.destroyed, true); |