Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rburgst/fastify-jest-timers

bug repo showing a fastify problem with jest fakeTimers
https://github.com/rburgst/fastify-jest-timers

Last synced: 2 days ago
JSON representation

bug repo showing a fastify problem with jest fakeTimers

Awesome Lists containing this project

README

        

# Fastify Hangs with Jest Sample repo

Sample repo demostrating a problem with fastify and using `jest.useFakeTimers` causing a hang.

To replicate:

* `npm install`
* `npm run test`

=> test hangs and fails with timeout.

Comment out

```javascript
// test/routes/root.test.js

// jest
// .useFakeTimers("modern")
// .setSystemTime(new Date("2020-02-08T20:10:21.520Z"));
```

to make it work.

See https://github.com/facebook/jest/issues/12056