-
Notifications
You must be signed in to change notification settings - Fork 524
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
Jest's expect toBeInstanceOf fails in rules_nodejs #1813
Comments
Thanks for the repo! I was just about to work on a repro for this issue I'm fixing the underlying cause so this is very helpful. It is fixed in different ways by both #1800 and #1805. #1800 has landed and #1805 is going to land today so the issue should be resolved on the next release which should come later today or tomorrow. Marking as fixed since #1800 was merged yesterday. |
Issue bazel-contrib#1813 was fixed by bazel-contrib#1800 which is already landed. bazel-contrib#1805 also fixes via a different mechanism and will also land soon.
Issue bazel-contrib#1813 was fixed by bazel-contrib#1800 which is already landed. bazel-contrib#1805 also fixes via a different mechanism and will also land soon.
Issue bazel-contrib#1813 was fixed by bazel-contrib#1800 which is already landed. bazel-contrib#1805 also fixes via a different mechanism and will also land soon.
Issue bazel-contrib#1813 was fixed by bazel-contrib#1800 which is already landed. bazel-contrib#1805 also fixes via a different mechanism and will also land soon.
Issue bazel-contrib#1813 was fixed by bazel-contrib#1800 which is already landed. bazel-contrib#1805 also fixes via a different mechanism and will also land soon.
Issue bazel-contrib#1813 was fixed by bazel-contrib#1800 which is already landed. bazel-contrib#1805 also fixes via a different mechanism and will also land soon.
@gregmagolan Thanks a lot, that's great news. I can confirm that the issue is resolved with |
I see that the Is there another bug that needs to be resolved before that pin can be removed? |
Hi! the Is it still needed? |
🐞 bug report
Affected Rule
The issue is caused by the rule:
jest_test
from@npm//jest-cli:index.bzl
Is this a regression?
Not that I'm aware of.
Description
A
jest
test
making use ofexpect(...).toBeInstanceOf(...)
fails when it should succeed, the same test succeeds when run usingyarn test
.🔬 Minimal Reproduction
master
fec40bbe7159854dbcb6c6f9ab81e28aa624e5d8
at the time of writing).yarn
and see it succeed:🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version
:Rules_nodejs version:
(Please check that you have matching versions between WORKSPACE file and
@bazel/*
npm packages.)Anything else relevant?
yarn
version 1.21.11node
version 13.7.0 underyarn
, tried both 12.13.0 and 13.7.0 underbazel
, issue observed in both cases.node_modules
contains multiple versions (.cjs.js
,.es.js
, ...) for the packagesjest-websocket-mock
andmock-socket
.It may be that the class
Server
is loaded from different versions betweenjest-websocket-mock
andmock-socket
and that this causes the discrepancy.Using
--node-options=--trace-event-categories=node
I've tried tracing which formats are loaded. Indeed, underyarn
I see that both modules are loaded from.cjs.js
files, while under Bazeljest-websocket-mock
is loaded from.cjs.js
butmock-socket
from plain.js
.However, I tried patching both packages to drop all but
.cjs.js
files and the issue persists. I've verified with--trace-event-categories
that in this case only.cjs.js
versions are loaded and thenode_modules
folder in the sandbox only contains.cjs.js
files.There are cases under which
isinstanceof
is problematic injest
(Jest globals differ from Node globals jestjs/jest#2549), however, to my understanding we shouldn't be affected by this issue in this case. If, we should be hitting it inyarn
as well, and I've tried the suggestedSingleContextNodeEnvironment
workaround without success.I tried using Babel as described in the
jest
example in therules_nodejs
repository but also without success.Test with Jest and Enzyme Internal Error #1651 could be a related issue.
Further context in Jest vs Bazel: Something is broken digital-asset/daml#5367
The text was updated successfully, but these errors were encountered: