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

toMatchInlineSnapshot does not clear existing snapshot in external file #6704

Closed
SimenB opened this issue Jul 17, 2018 · 3 comments
Closed

Comments

@SimenB
Copy link
Member

SimenB commented Jul 17, 2018

🐛 Bug Report

A clear and concise description of what the bug is.

To Reproduce

test("some test", () => {
  expect({}).toMatchSnapshot();
});

Run that test and the snapshot is saved.

Change to

test("some test", () => {
  expect({}).toMatchInlineSnapshot();
});

and the snapshot will be added inline, but the original snapshot (in __snapshots__) will not be deleted.

Expected behavior

The original snapshot on disk should be deleted.

Link to repl or repo (highly encouraged)

https://github.com/SimenB/jest-inline

Run npx envinfo --preset jest

Paste the results here:

  System:
    OS: macOS Sierra 10.12.6
    CPU: x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
  Binaries:
    Node: 8.11.1 - ~/.nvm/versions/node/v8.11.1/bin/node
    Yarn: 1.7.0 - /usr/local/bin/yarn
    npm: 6.1.0 - ~/.nvm/versions/node/v8.11.1/bin/npm
  npmPackages:
    jest: ^23.4.1 => 23.4.1
@SimenB
Copy link
Member Author

SimenB commented Jul 17, 2018

/cc @azz

@SimenB
Copy link
Member Author

SimenB commented Jul 19, 2018

Hah, dupe of #6655

@SimenB SimenB closed this as completed Jul 19, 2018
@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 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant