Skip to content

Commit

Permalink
try using with syntax with node 20
Browse files Browse the repository at this point in the history
  • Loading branch information
bumblehead committed Apr 25, 2024
1 parent 802b7e6 commit 82516d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/tests-node/esmock.node.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ test('should mock an exported array', async () => {
})

test('should mock imported json', async () => {
const importsJSONPath = 22 >= +process.versions.node.split('.')[0]
const importsJSONPath = 20 >= +process.versions.node.split('.')[0]
? '../local/importsJSONfile.with.js'
: '../local/importsJSONfile.assert.legacy.js'
const importsJSON = await esmock(importsJSONPath, {
Expand All @@ -569,7 +569,7 @@ test('should mock imported json', async () => {
})

test('should mock imported json (strict)', async () => {
const importsJSONPath = 22 >= +process.versions.node.split('.')[0]
const importsJSONPath = 20 >= +process.versions.node.split('.')[0]
? '../local/importsJSONfile.with.js'
: '../local/importsJSONfile.assert.legacy.js'
const importsJSON = await esmock.strict(importsJSONPath, {
Expand Down

0 comments on commit 82516d6

Please sign in to comment.