Skip to content

Commit

Permalink
fix: make mock-agent.js test more resilient (#2780)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak authored and ronag committed Feb 22, 2024
1 parent 917ace0 commit ec405e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/mock-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -775,8 +775,8 @@ test('MockAgent - handle delays to simulate work', async (t) => {

const response = await getResponse(body)
t.strictEqual(response, 'hello')
const elapsedInMs = process.hrtime(start)[1] / 1e6
t.ok(elapsedInMs >= 49, `Elapsed time is not greater than 50ms: ${elapsedInMs}`)
const elapsedInMs = Math.ceil(process.hrtime(start)[1] / 1e6)
t.ok(elapsedInMs >= 50, `Elapsed time is not greater than 50ms: ${elapsedInMs}`)
})

test('MockAgent - should persist requests', async (t) => {
Expand Down

0 comments on commit ec405e4

Please sign in to comment.