Skip to content
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

JSDOM overrides Uint8Array implementation #9993

Closed
TrySound opened this issue May 7, 2020 · 3 comments
Closed

JSDOM overrides Uint8Array implementation #9993

TrySound opened this issue May 7, 2020 · 3 comments

Comments

@TrySound
Copy link
Contributor

TrySound commented May 7, 2020

🐛 Bug Report

I got a case yesterday where default environment makes this expression buffer instanceof Uint8Array falsy.

This looks like related issue #9983

To Reproduce

Steps to reproduce the behavior:

  • install jest
  • add test.js with the following code
const fs = require('fs');
test('test buffer', () => {
  const buffer = Buffer.from('')
  expect(buffer instanceof Uint8Array).toBeTruthy()
})

The test will fail. Though when I set node environment everything works again.

Expected behavior

Buffer extends Uint8Array and instanceof should work with jsdom.

Link to repl or repo (highly encouraged)

https://repl.it/repls/CanineSpicyPetabyte

envinfo

  System:
    OS: macOS Mojave 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Binaries:
    Node: 13.12.0 - /var/folders/93/vjl05hsx4_vdnhvdtky_qx8m0000gn/T/fnm-shell-3627797/bin/node
    Yarn: 1.18.0 - /usr/local/bin/yarn
    npm: 6.14.4 - /var/folders/93/vjl05hsx4_vdnhvdtky_qx8m0000gn/T/fnm-shell-3627797/bin/npm
  npmPackages:
    jest: ^26.0.1 => 26.0.1 
@jacogr
Copy link

jacogr commented May 7, 2020

Think this is the same issue as I had in #9983 - this seems to be the underlying cause.

@thymikee
Copy link
Collaborator

thymikee commented May 7, 2020

Let's close this one then and continue on #9983, hope you don't mind @TrySound

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants