Skip to content

Commit

Permalink
update JSON test
Browse files Browse the repository at this point in the history
  • Loading branch information
bumblehead committed Oct 17, 2023
1 parent cd2530a commit c5eb9ea
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/tests-node/esmock.node.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,26 +541,26 @@ test('should mock imported json', async () => {
const importsJSON = await esmock(
'../local/importsJSONfile.js', {
'../local/example.json': {
'test-example': 'test-json'
'test-example': 'test-json-a'
}
})

assert.strictEqual(
Object.keys(importsJSON.JSONobj).sort().join(), 'example,test-example')
assert.strictEqual(importsJSON.JSONobj['test-example'], 'test-json')
assert.strictEqual(importsJSON.JSONobj['test-example'], 'test-json-a')
assert.strictEqual(importsJSON.JSONobj['example'], 'json')
})
/*

test('should mock imported json (strict)', async () => {
const importsJSON = await esmock.strict(
'../local/importsJSONfile.js', {
'../local/example.json': {
'test-example': 'test-json'
'test-example': 'test-json-b'
}
})

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

0 comments on commit c5eb9ea

Please sign in to comment.