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

ReactNative snapshot tests failing locally for me on 'master' branch #9653

Closed
flarnie opened this issue May 10, 2017 · 2 comments
Closed

ReactNative snapshot tests failing locally for me on 'master' branch #9653

flarnie opened this issue May 10, 2017 · 2 comments
Assignees

Comments

@flarnie
Copy link
Contributor

flarnie commented May 10, 2017

Do you want to request a feature or report a bug?
This is probably some kind of bug with our tests.

What is the current behavior?
When I run npm run test ReactNative there are two failing snapshot tests. The failures have to do with escape characters that seem to be missing from the generated snapshot. See the below screenshot:
screen shot 2017-05-10 at 5 53 53 pm

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/84v837e9/).

On my machine - npm run test ReactNative, on the latest master branch.

What is the expected behavior?
The snapshot tests should pass, just as they are passing in CircleCI. https://circleci.com/gh/facebook/react/3237

@flarnie
Copy link
Contributor Author

flarnie commented May 10, 2017

This may be related to the jest version I have installed - ran yarn install and then npm run test ReactNative and got the following message:

    Outdated snapshot: No snapshot header found. Jest 19 introduced versioned snapshots to ensure all developers on a project are using the same version of Jest. Please update all snapshots during this upgrade of Jest.
    
    Warning: Before you upgrade snapshots, we recommend that you revert any local changes to tests or other code, to ensure that you do not store invalid state.

Going to try rm -rf node_modules && yarn install && npm run test ReactNative and see if that helps.

@flarnie
Copy link
Contributor Author

flarnie commented May 11, 2017

Pretty sure I figured it out - I had Jest v20.0.0 installed globally, and for some reason I think it was being used to run the tests in React, even though our package.json has "jest": "^19.0.1",.

I uninstalled the global version of Jest, ran the tests on master, and they pass.

@flarnie flarnie closed this as completed May 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant