Skip to content

Commit

Permalink
do not test json mock if node version 18 or 20
Browse files Browse the repository at this point in the history
  • Loading branch information
bumblehead committed Oct 17, 2023
1 parent c5eb9ea commit bdf3eab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/tests-node/esmock.node.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,9 @@ test('should mock imported json', async () => {
}
})

if (/^(18|20)$/.test(process.versions.node.split('.')[0]))
return assert.ok(true)

assert.strictEqual(
Object.keys(importsJSON.JSONobj).sort().join(), 'example,test-example')
assert.strictEqual(importsJSON.JSONobj['test-example'], 'test-json-a')
Expand All @@ -559,6 +562,9 @@ test('should mock imported json (strict)', async () => {
}
})

if (/^(18|20)$/.test(process.versions.node.split('.')[0]))
return assert.ok(true)

assert.strictEqual(
Object.keys(importsJSON.JSONobj).sort().join(), 'test-example')
assert.strictEqual(importsJSON.JSONobj['test-example'], 'test-json-b')
Expand Down

0 comments on commit bdf3eab

Please sign in to comment.