Skip to content

Commit

Permalink
update feature detection for no loader test
Browse files Browse the repository at this point in the history
  • Loading branch information
bumblehead committed Sep 9, 2023
1 parent 4d42f38 commit 51f08ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/tests-no-loader/esmock.noloader.test.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down

0 comments on commit 51f08ca

Please sign in to comment.