D
Deno
B
Deno
β’
3y ago
Bustin Base
FakeTime seems to break async tests
I am attempting to use FakeTime similarly to in the Faking time example of
https://deno.land/manual@v1.35.1/basics/testing/mocking
But whenever I run the tests it responds with
:
error
: Promise resolution is still pending but the event loop has already resolved
"
The test partially runs but it seems to reach a point where it calls setTimeout and then just exits
.
If I remove the reference to fake time then the test runs as expected
, it just takes a little more time
.
Does anyone have any experience with using FakeTime in an asynchronous test
? The function its getting hung up on is the std library
retry
retry
function
.
Deno
Mocking | Manual | Deno
Test spies are function stand
-ins that are used to assert if a function
's
internal behavior matches expectations
. Test spies on methods keep the original
behavior but allow you to test how the method
Deno
Join
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
BDD with async tests
F
FjordWarden / help
3y ago
adding async data to array?
J
Jordan / help
4y ago
async map
L
leigh / help
3y ago