-
Notifications
You must be signed in to change notification settings - Fork 416
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
react_with_node does not work! #156
Comments
One note, the tests will run on basic JS files, but when the test file contains an import of JSX, then babel or something can't deal with it. |
I haven't had a chance to clone your repo and try it out yet, but I'm guessing the problem is that this rule in webpack.config.js doesn't match the spec file:
The first thing I'd try is renaming the file to If that doesn't work, try changing the test to something like |
Actually, disregard the above. I misunderstood what's going on. There are basically two problems:
The easiest way to get it all working is to fix the helper file directory name, then rename the spec file to I suspect that you'd have to move away from |
BTW, I've removed the mentions of Enzyme from the tutorial. That recommendation was sadly out of date: Enzyme was a good choice for new projects when the tutorial was first written, but today it's two major React versions behind and doesn't appear to be getting the kind of contributor support that it would take to catch up. I recommend using react-testing-library instead. |
So I'll look at your comments. I was fairly sure helpers were being loaded because adding console logs to them shows that they at least get executed. Also, Tests also do execute, but when I import jsx they faile |
You were spot on, Thank you for your help, I guess I have to go figure out what is breaking in my real project now Thanks for this. |
I'm glad I was able to help. Feel free to open another issue if you run into more problems. |
I have spent about 6 hours following this tutorial. I finally decided to create a new React 16 app from scratch to make sure there wasn't some sort of configuration problem but I'm going to have to say there is something missing. Either You cannot test a React App with Jasmine or this Tutorial is not correct:
'https://jasmine.github.io/tutorials/react_with_node'
When running the test you get:
I created this very basic repo to try this out after I couldn't get it working on my project:
https://github.com/kevinlbatchelor/ReactJasmineTest
Any help would be much appreciated. In fact I'll help if someone can point me in the right direction.
The text was updated successfully, but these errors were encountered: