Jest RANDOMBYTESREQUEST
See original GitHub issueDescribe the bug
uuid is not allowing jest to exit:
Jest has detected the following 1 open handle potentially keeping Jest from exiting:
● RANDOMBYTESREQUEST
3 | import { UserAuth } from 'src/auth/dto/user.jwt';
4 |
> 5 | export const CurrentUser = createParamDecorator(
| ^
6 | (data: unknown, context: ExecutionContext): UserAuth => {
7 | const ctx = GqlExecutionContext.create(context);
8 | return ctx.getContext().req.user;
at rng (node_modules/uuid/dist/rng.js:18:21)
at Object.v4 (node_modules/uuid/dist/v4.js:17:63)
at Object.createParamDecorator (node_modules/@nestjs/common/decorators/http/create-route-param-metadata.decorator.js:14:30)
at Object.<anonymous> (src/common/guards/current-user.guard.ts:5:28)
the error is located on https://github.com/uuidjs/uuid/blob/91805f665c38b691ac2cbda56a99231432b00a1a/src/rng.js#L8
How to reproduce
on a Nestjs server just execute:
jest --runInBand --detectOpenHandles
Expected behavior
exit jest without open handlers
Runtime
- OS: macOs
- Runtime: Node.js
- Runtime Version: v15.6.0
Additional information
https://stackoverflow.com/questions/66958699/jest-open-handle-randombytesrequest-on-nestjs-graphql
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Jest and RANDOMBYTESREQUEST open handles
RANDOMBYTESREQUEST issue is in JEST. Initial investigation is in : https://github.com/facebook/jest/issues/11275.
Read more >jest | Yarn - Package Manager
Jest. Delightful JavaScript Testing. Developer Ready: Complete and ready to set-up JavaScript testing solution. Works out of the box for...
Read more >How To Mock uuid In Jest - I Like Kill Nerds
You can create an actual mock module that gets loaded in place of the dependency in your app or you can do it...
Read more >[Solved]-Jest + Supertest | Jest detecting open handles-node.js
Coding example for the question Jest + Supertest | Jest detecting open ... Jest open handle RANDOMBYTESREQUEST on NestJS GraphQL · Jest did...
Read more >jest 27.0.0 on Node.js Yarn - NewReleases.io
New release jest version 27.0.0 on Node.js Yarn. ... [jest-core] Do not collect RANDOMBYTESREQUEST as open handles (#11278); [jest-core] Wait briefly for ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah there were recently some changes in this area that may be causing this. I’ll investigate this morning. randomFillSync uses the same underlying mechanism as randomFill but invokes it synchronously. It’s supposed to be marked weak so gc can clean it up immediately after but this error suggests that might not be happening so that’s where I’ll look first.
Any time, happy to help 😃