-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work within jest #318
Comments
I'm very curious what happens here. It shouldn't be possible for anyone to modify the |
I would highly recommend to not use jest as it provides different globals for each test, making all those check fail. |
@mcollina I guess you recommend using We once hit a similar problem in Prisma Client, where we had an |
It's kinda awkward to add jest in there, but this is the only sane way I found to add the test #319 |
Sorry about Jest causing issues 🙁 The issue to track (if anybody wants) in Jest for this is jestjs/jest#2549. I've tried multiple times to fix it without luck. I believe it can be solved if these two are ever solved: |
When running an undici client in jest, jest is doing some kind of override magic in the background, that makes this check for a buffer in undici fail.
Reproduction: https://github.com/timsuchanek/undici-buffer-repro
I'm already working on a fix :) I suggest adding a
|| Buffer.isBuffer(body)
in https://github.com/mcollina/undici/blob/master/lib/client.js#L946The text was updated successfully, but these errors were encountered: