Skip to content

Remove snapshot files when a test file stops using snapshots #1424

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

Closed
novemberborn opened this issue Jun 28, 2017 · 7 comments · Fixed by #2623
Closed

Remove snapshot files when a test file stops using snapshots #1424

novemberborn opened this issue Jun 28, 2017 · 7 comments · Fixed by #2623
Assignees
Labels
enhancement new functionality 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted scope:snapshot-management

Comments

@novemberborn
Copy link
Member

novemberborn commented Jun 28, 2017

Issuehunt badges

When --update-snapshots is passed, if AVA executes a test file for which there are snapshots, but no snapshot assertion is run, we should remove the snapshot files.

What's tricky though is if tests are skipped, or if snapshot assertions are skipped, we should not remove the snapshot files.

See https://github.com/avajs/ava/blob/9d3b1bad681e1aad18ad8cd53407a7ccb1fc5782/lib/runner.js#L205:L207.


IssueHunt Summary

ninevra ninevra has been rewarded.

Backers (Total: $60.00)

Submitted pull Requests


Tips

@lo1tuma
Copy link
Contributor

lo1tuma commented Jan 3, 2019

I wonder if Runner is the correct place to implement this. If I remove a test file then the highlighted code in Runner would be never executed, right?

@novemberborn
Copy link
Member Author

Correct, but this issue is for the scenario where the test file still exists.

@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label May 10, 2019
@IssueHuntBot
Copy link

@IssueHunt has funded $60.00 to this issue.


@ninevra
Copy link
Contributor

ninevra commented Dec 6, 2020

I'd like to work on this, if that's alright?

@novemberborn
Copy link
Member Author

@ninevra yea that'd be great!

@ninevra
Copy link
Contributor

ninevra commented Jan 23, 2021

@novemberborn could you award the bounty on this? sorry, i think i submitted the pr on issuehunt too late, which caused the bounty not to be awarded automatically.

@issuehunt-oss issuehunt-oss bot removed the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label Jan 23, 2021
@issuehunt-oss
Copy link

issuehunt-oss bot commented Jan 23, 2021

@novemberborn has rewarded $54.00 to @ninevra. See it on IssueHunt

  • 💰 Total deposit: $60.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $6.00

@issuehunt-oss issuehunt-oss bot added the 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt label Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new functionality 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted scope:snapshot-management
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants