jest-cucumber
jest-cucumber copied to clipboard
Can't test the front-end using testing library
I've been configuring jest-cucumber to set it up in my project (NextJS), however, I realized that jest-cucumber just work if I set up Jest with -> testEnvironment="Node". It works if I just test mathematical functions, however, in case I try to render some React components, it just crashes. I'm wondering if jest-cucumber has been developed for server side and not for the front-end.
Here the output and my setup:
Jest config:
jest-cucumber setup file (without it, the test fails as well):
The test example using React Testing Library:
The output of the test:
<> - I installed all the main packages such as ts-jest, etc to transform the main files. <> - I'm using some testing tools besides jest-cucumber such as Jest and React Testing Library.
Thanks for the help
** Update ** You can use the package called "jsdom-global" so you can render a dom in nodejs You just have to require it in every test since Jest has to be configured to use "Node" as testEnvironment
** Update ** You can use the package called "jsdom-global" so you can render a dom in nodejs You just have to require it in every test since Jest has to be configured to use "Node" as testEnvironment
Do you have an example? I've tried to require it but it's still not working for me
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue is closed because there has been no recent activity.