Skip to content
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

Merged
merged 4 commits into from
Sep 18, 2017
Merged

New example react redux node #4491

merged 4 commits into from
Sep 18, 2017

Conversation

jenniferabowd
Copy link
Contributor

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.

  1. cd examples
  2. cd react-redux-node-webpack-snapshot
  3. npm i --save
  4. 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.

@cpojer
Copy link
Member

cpojer commented Sep 16, 2017

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?

@jenniferabowd
Copy link
Contributor Author

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

@jenniferabowd
Copy link
Contributor Author

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.

@cpojer
Copy link
Member

cpojer commented Sep 17, 2017

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

@jenniferabowd
Copy link
Contributor Author

Hi @cpojer thank you for your help! I made those changes and linked to it in the Webpack document file.

@codecov-io
Copy link

Codecov Report

Merging #4491 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

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

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3aebe4f...6608117. Read the comment docs.

@cpojer cpojer merged commit 95278b2 into jestjs:master Sep 18, 2017
@cpojer
Copy link
Member

cpojer commented Sep 18, 2017

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

tabrindle pushed a commit to tabrindle/jest that referenced this pull request Oct 2, 2017
* 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
@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants