Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
it('Verify that async function is working properly', async () => {
const data = { f: 10 }
- const startTime = new Date().getTime()
+ const startTime = Date.now()
const result = await asyncPool.execute(data)
- const usedTime = new Date().getTime() - startTime
+ const usedTime = Date.now() - startTime
expect(result).toStrictEqual(data)
expect(usedTime).toBeGreaterThanOrEqual(2000)
})
it('Verify that async function is working properly', async () => {
const data = { f: 10 }
- const startTime = new Date().getTime()
+ const startTime = Date.now()
const result = await asyncPool.execute(data)
- const usedTime = new Date().getTime() - startTime
+ const usedTime = Date.now() - startTime
expect(result).toStrictEqual(data)
expect(usedTime).toBeGreaterThanOrEqual(2000)
})