-
Notifications
You must be signed in to change notification settings - Fork 419
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
yarn test is failing for me locally #1035
Comments
I can confirm it's node v10 failing, and not node v9. |
I don't have any issue on Linux (tried with both v10.0.0 and v10.2.0). One possibility is that ArrayBuffer in jsdom is different than the native ArrayBuffer. Looking at jsdom's code, it would be surprising, but well. One way to check this is running this in node v10: const jsdom = require("jsdom");
const { JSDOM } = jsdom;
const { window } = new JSDOM();
console.log(window.ArrayBuffer === ArrayBuffer); (I can't check myself since I don't have the issue :) ) Unrelated: my search-fu helped me find this random commit: https://github.com/apache/arrow/pull/2049/files#diff-d8a9e815a7bbcefb3c4ef1bec13ffad8R21, which could show an issue around ArrowBuffer in node v10... |
Ah I read in jestjs/jest#4422 that Jest provides custom versions of Buffer types... Could this come from the recent upgrade of Jest? |
I also found jestjs/jest#3186 but this seems an ancient bug. |
Additional note about the latter: we don't use the "node" environment, but the "jsdom" environment. |
I've reduced it down to this printing console.log(new Uint8Array().buffer instanceof ArrayBuffer); I'm going to try to reproduce it in a standalone Jest environment and see whether it's a regression in Jest. |
I've filed jestjs/jest#6248 about this and have a workaround. |
I tried a few earlier versions of Jest and they all had the same problem, so I don't think it's related to the recent update. |
I'm a maintainer for jsdom, and can confirm that this issue is unrelated to Jest. One of our tests also broke in Node v10 for this reason, but we have yet to discover the cause beyond what you've established here. It presumably comes down to a change in the Node.js |
Thanks for the confirmation! Has an issue been filed in the right place which I could reference? |
Unfortunately I never got to the point of producing a minimal reproduction case due to time constraints (with jsdom being a spare time project). At the time I was hoping that the issue might get reported by other affected packages, but that doesn't seem to have happened. I guess our use of the |
@mstange If you'd like to update the reference, there's now an issue for this in the Node.js-repo: nodejs/node#20978 |
I'm using node v10.0.0.
I've tracked it down to this check inside
getTypeOf
in thejszip
module:input instanceof ArrayBuffer
is false. ButObject.prototype.toString.call(input) === "[object ArrayBuffer]"
.Maybe we're picking up two conflicting definitions of
ArrayBuffer
somehow?The text was updated successfully, but these errors were encountered: