You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Buffer shouldn't exist in JSDOM at all - it's a node specific global and will break if you run it in a real browser. I wanna remove it entirely, but there's a performance regression for some reason: #11241.
For the browser there are packages like https://www.npmjs.com/package/buffer (which is used by browserify). So it's not a problem at all. The question is how to get consistent experience in JSDOM.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Version
29.2.2
Steps to reproduce
Clone https://github.com/sergekh2/jest-buffer-test-fail
yarn install
yarn test-node
yarn test-jsdom
Expected behavior
Last test passes.
Actual behavior
Test fails since Buffer is not instance of UInt8Array
Additional context
In node environment node's Buffer is instance of UInt8Array and test passes.
In jsdom Jest brings in Buffer implementation which is not instance of UInt8Array, test fails.
Test code:
Environment
The text was updated successfully, but these errors were encountered: