-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
New example react redux node #4491
New example react redux node #4491
Conversation
Woah, this is such a thorough example, thank you @jenniferkaplannyc. I'm a bit worried about adding this to the Jest repo because the examples are meant to be lightweight and if we have to maintain so much code when we change Jest, that may slow us down. What do you think about maintaining this example repository on your own and linking to it in the Jest documentation? Would that work for you? |
@cpojer Hi, we can do that if you want, however, right now we do not have any examples that are linked like that. Where would you like me to link it? Maybe I should do it in the readme in the examples folder. My goal is to have this be as visible as possible to help people experiencing these problems. |
Another idea is to keep it in this folder, but have a disclaimer saying that it was created in September 2017 and may not be up to date with Jest. I also am going to do my best to maintain it. |
Hey! The problem is that we actively maintain the examples with newer versions of Jest and it is a lot of work with the existing ones already. If we put it into this repo, the maintenance burden falls entirely on us. How about adding a link to this example to "Using webpack" docs page? Alternatively, I'm also happy if you add a separate page to Jest called "Example Projects" in which you link to example projects, with your one on top of course :) |
…the webpack readme
Hi @cpojer thank you for your help! I made those changes and linked to it in the Webpack document file. |
Codecov Report
@@ Coverage Diff @@
## master #4491 +/- ##
=======================================
Coverage 56.85% 56.85%
=======================================
Files 186 186
Lines 6300 6300
Branches 3 3
=======================================
Hits 3582 3582
Misses 2717 2717
Partials 1 1 Continue to review full report at Codecov.
|
Thank you so much for sending this PR and creating this example. It's very educational. Are you on twitter? Let me know if you are tweeting about your example, I'd like to retweet it :) |
* new example for snapshots * new example for snapshots with new folder name * removed my example from the example folder, linked to the example in the webpack readme * actually removed the example I wrote
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
I struggled with using Jest for the first time on a large app for work that was using React, Redux, Node, and Webpack. So I created a scaled down version of the app that is still as complex to show how to get passing snapshot tests in this situation. Some things that broke it was a loading gif and API calls from the Node backend. This will address all those issues.
Test plan
Run the following commands.
cd examples
cd react-redux-node-webpack-snapshot
npm i --save
npm test
You will then see a passing snapshot test. If you look at the code you will see it is more complex than the current examples.