Skip to content

Commit

Permalink
update JSON test
Browse files Browse the repository at this point in the history
  • Loading branch information
bumblehead committed Nov 4, 2023
1 parent 014d3cc commit 57edc34
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/tests-node/esmock.node.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,27 +553,25 @@ 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 57edc34

Please sign in to comment.