Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should serve from queued request', async () => {
jsonloaderReq['temp.json'] = new Promise((resolve) => resolve({ foo: 'bar' }))
expect(await jsonloader('temp.json')).to.deep.equal({ foo: 'bar' })
})
it('should retrieve from cache', async () => {
jsonloaderCache['temp.json'] = { foo: 'bar' }
expect(await jsonloader('temp.json')).to.deep.equal({ foo: 'bar' })
})