diff --git a/tests/tests-no-loader/esmock.noloader.test.js b/tests/tests-no-loader/esmock.noloader.test.js index 65304639..f06cffc0 100644 --- a/tests/tests-no-loader/esmock.noloader.test.js +++ b/tests/tests-no-loader/esmock.noloader.test.js @@ -1,12 +1,13 @@ import test from 'node:test' import assert from 'node:assert/strict' import module from 'node:module' +import threads from 'node:worker_threads' import esmock from 'esmock' import esmockErr from '../../src/esmockErr.js' // newer versions of node support module.register, do not need --loader // older versions of node need --loader -if (module.register) { +if (module.register && threads.MessageChannel) { test('should mock a module', async () => { const main = await esmock('../local/mainUtil.js', { 'form-urlencoded': () => 'mock encode'