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
In the latest version of Jest (26.6.3) new Float32Array( 1 ).buffer instanceof ArrayBuffer returns false causing tests to fail.
To Reproduce
The following test fails in v26.6.3 but passes in v25.5.4 with no extra configuration:
describe('Float32Array.buffer',()=>{it('should be an instance of ArrayBuffer',()=>{expect(newFloat32Array().bufferinstanceofArrayBuffer).toBeTruthy();});});
Expected behavior
That new Float32Array().buffer instanceof ArrayBuffer return true like it does in the browser and node.
envinfo
System:
OS: macOS High Sierra 10.13.6
Binaries:
Node: 13.8.0
Yarn: 1.10.1
npm: 6.13.7
npmPackages:
jest: ^26.6.3 => 26.6.3
The text was updated successfully, but these errors were encountered:
That’s because Jest uses a new VM context, and overrides the VM context’s ArrayBuffer with the top‑level global object’s ArrayBuffer, but doesn’t do this for typed arrays, which construct their ArrayBuffers using the overwritten ArrayBuffer constructor:
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.
🐛 Bug Report
In the latest version of Jest (26.6.3)
new Float32Array( 1 ).buffer instanceof ArrayBuffer
returnsfalse
causing tests to fail.To Reproduce
The following test fails in v26.6.3 but passes in v25.5.4 with no extra configuration:
Expected behavior
That
new Float32Array().buffer instanceof ArrayBuffer
return true like it does in the browser and node.envinfo
The text was updated successfully, but these errors were encountered: