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

Updating snapshots is not working in watch mode #3297

Closed
rogeliog opened this issue Apr 13, 2017 · 4 comments · Fixed by #3298
Closed

Updating snapshots is not working in watch mode #3297

rogeliog opened this issue Apr 13, 2017 · 4 comments · Fixed by #3298

Comments

@rogeliog
Copy link
Contributor

rogeliog commented Apr 13, 2017

Do you want to request a feature or report a bug?
bug

What is the current behavior?
Pressing u in watch mode does not update the snapshots, but it works when passing -u in non watch mode.

What is the expected behavior?
Snapshots should update

Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.

Master at this commit 6517c7b

I think it broke after #3289 cc: @cpojer

@cpojer
Copy link
Member

cpojer commented Apr 13, 2017

yap, that might have been me :)

@thymikee
Copy link
Collaborator

This is happening because now we have 2 configs: config and hasteContext.config and some of the dynamic properties (like updateSnapshot) don't get copied to hasteContext.config.

So, experimentally, adding something like this in runJest helps:

if (config.updateSnapshot === true) {
  hasteContext.config.updateSnapshot = true;
}

but that's certainly not a good solution. Why these 2 configs differ now anyways, shouldn't we keep them in sync until we have shared/project configs?

@cpojer
Copy link
Member

cpojer commented Apr 13, 2017

@thymikee that workaround is good for now. I will address this in a follow-up to the multi-config runner PR as we discussed when I'll make the split for SharedConfig and ProjectConfig. Mind sending a PR with the change you proposed (+ a test!) so that I can fix it properly for Jest 20? :)

@github-actions
Copy link

This issue 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.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants