diff --git a/test/parallel/test-stream-push-strings.js b/test/parallel/test-stream-push-strings.js index c2383f3de1de4f..d582c8add005a5 100644 --- a/test/parallel/test-stream-push-strings.js +++ b/test/parallel/test-stream-push-strings.js @@ -36,15 +36,15 @@ class MyStream extends Readable { case 0: return this.push(null); case 1: - return setTimeout(function() { + return setTimeout(() => { this.push('last chunk'); - }.bind(this), 100); + }, 100); case 2: return this.push('second to last chunk'); case 3: - return process.nextTick(function() { + return process.nextTick(() => { this.push('first chunk'); - }.bind(this)); + }); default: throw new Error('?'); } diff --git a/test/parallel/test-stream2-transform.js b/test/parallel/test-stream2-transform.js index 0f12476f506a93..38f6bc64db35a7 100644 --- a/test/parallel/test-stream2-transform.js +++ b/test/parallel/test-stream2-transform.js @@ -211,14 +211,14 @@ const Transform = require('_stream_transform'); if (!chunk) chunk = ''; const s = chunk.toString(); - setTimeout(function() { + setTimeout(() => { this.state += s.charAt(0); if (this.state.length === 3) { pt.push(Buffer.from(this.state)); this.state = ''; } cb(); - }.bind(this), 10); + }, 10); }; pt._flush = function(cb) {