diff --git a/test/parallel/test-stream2-writable.js b/test/parallel/test-stream2-writable.js index 5b25da0b67c0b8..7c5f825a575d69 100644 --- a/test/parallel/test-stream2-writable.js +++ b/test/parallel/test-stream2-writable.js @@ -322,13 +322,14 @@ for (let i = 0; i < chunks.length; i++) { assert.strictEqual(this.writing, undefined); wrote = true; this.writing = true; - setTimeout(function() { + setTimeout(() => { this.writing = false; cb(); }, 1); }; w.on('finish', common.mustCall(function() { assert.strictEqual(wrote, true); + assert.strictEqual(this.writing, false); })); w.write(Buffer.alloc(0)); w.end();