diff --git a/test/parallel/test-next-tick.js b/test/parallel/test-next-tick.js index 9c69efeb784d64..511d0559cd1e94 100644 --- a/test/parallel/test-next-tick.js +++ b/test/parallel/test-next-tick.js @@ -21,6 +21,7 @@ 'use strict'; const common = require('../common'); + const assert = require('assert'); process.nextTick(common.mustCall(function() { @@ -40,8 +41,23 @@ const obj = {}; process.nextTick(function(a, b) { assert.strictEqual(a, 42); assert.strictEqual(b, obj); + assert.strictEqual(this, undefined); }, 42, obj); +process.nextTick((a, b) => { + assert.strictEqual(a, 42); + assert.strictEqual(b, obj); + assert.deepStrictEqual(this, {}); +}, 42, obj); + +process.nextTick(function() { + assert.strictEqual(this, null); +}, 1, 2, 3, 4); + +process.nextTick(() => { + assert.deepStrictEqual(this, {}); +}, 1, 2, 3, 4); + process.on('exit', function() { process.nextTick(common.mustNotCall()); });