Skip to content

Error when using example in documentation #441

Answered by davidlag0
davidlag0 asked this question in Q&A
Discussion options

You must be logged in to vote

@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:

/**
 * @jest-environment node
 */

Thank you very much for your quick answer and pointers, it helped a lot to help me figure out a solution!

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@davidlag0
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by davidlag0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants