Skip to content

refactor(testing): add instructions to update snapshots #6543

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

Merged
merged 3 commits into from
Apr 1, 2025

Conversation

WWRS
Copy link
Contributor

@WWRS WWRS commented Mar 31, 2025

closes #6542

I chose to use [TEST FILE PATH] instead of adding the file path so that the tests in snapshot_test.ts.snap wouldn't be affected by where the test is being run from. It would probably be possible to add the relative path using something like

PlatformPath.relative(Deno.cwd(), context.origin)

though this would require additional testing

@WWRS WWRS requested a review from kt3k as a code owner March 31, 2025 04:20
Copy link

codecov bot commented Mar 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.08%. Comparing base (616f66d) to head (593dee8).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6543   +/-   ##
=======================================
  Coverage   95.08%   95.08%           
=======================================
  Files         576      576           
  Lines       43345    43346    +1     
  Branches     6466     6466           
=======================================
+ Hits        41216    41217    +1     
  Misses       2089     2089           
  Partials       40       40           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kt3k kt3k changed the title chore(testing): add instructions to update snapshots refactor(testing): add instructions to update snapshots Apr 1, 2025
@kt3k
Copy link
Member

kt3k commented Apr 1, 2025

I chose to use [TEST FILE PATH] instead of adding the file path so that the tests in snapshot_test.ts.snap wouldn't be affected by where the test is being run from.

That sounds good. I also updated the placeholder to [files]... to align it to deno test --help output

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice! Thanks

@kt3k kt3k merged commit 68a8460 into denoland:main Apr 1, 2025
18 checks passed
@WWRS WWRS deleted the how-snap-update branch April 1, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show how to update snapshots when snapshot assertion failed
2 participants