diff --git a/test/addons/worker-buffer-callback/test-free-called.js b/test/addons/worker-buffer-callback/test-free-called.js index 2a3cc9e47c22ff..c15cdde432cd31 100644 --- a/test/addons/worker-buffer-callback/test-free-called.js +++ b/test/addons/worker-buffer-callback/test-free-called.js @@ -6,12 +6,14 @@ const { Worker } = require('worker_threads'); const binding = path.resolve(__dirname, `./build/${common.buildType}/binding`); const { getFreeCallCount } = require(binding); +// getFreeCallCount initial value is 0 +assert.strictEqual(getFreeCallCount(), 0); + // Test that buffers allocated with a free callback through our APIs are // released when a Worker owning it exits. const w = new Worker(`require(${JSON.stringify(binding)})`, { eval: true }); -assert.strictEqual(getFreeCallCount(), 0); w.on('exit', common.mustCall(() => { assert.strictEqual(getFreeCallCount(), 1); }));