-
Hi, First, thank you for this library! I'm really glad someone put in the time to build all these functionalities into a simple library to use! I'm trying to use this example in the documentation that perfectly fits my use case:
When I use And when the example code is run, I get this error message:
I am running the very same code there is in the documentation I provided the link for above:
I am currently using the last version available from npm: 4.9.0. How could I resolve this issue? Thank you very much! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Are you running this directly in Node.js? In case you don't, run this issue by whomever orchestrates your node runtime. This is a common issue nowadays when people run their code in a vm (node vm builtin) but don't correctly pass global javascript constructors, which in tirn makes the instanceof operator fail like it does for you. |
Beta Was this translation helpful? Give feedback.
-
@panva This lead me to add this at the top of the file with my tests that require a node environment:
Thank you very much for your quick answer and pointers, it helped a lot to help me figure out a solution! |
Beta Was this translation helpful? Give feedback.
@panva
After additional research following your pointers, I did some more tests such as changing the overall environment. It lead to different issues with other tests I have for the frontend part of the app so I couldn't do this. I ended up keeping the very same Jest config because I came across this: https://stephenweiss.dev/jest-test-environments
This lead me to add this at the top of the file with my tests that require a node environment:
Thank you very much for your quick answer and pointers, it helped a lot to help me figure out a solution!