-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
test_runner: add t.assert.fileSnapshot() #56459
Conversation
Review requested:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #56459 +/- ##
=======================================
Coverage 89.16% 89.17%
=======================================
Files 662 662
Lines 191668 191731 +63
Branches 36884 36894 +10
=======================================
+ Hits 170908 170967 +59
+ Misses 13621 13620 -1
- Partials 7139 7144 +5
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I think adding a base path that's going to be applied to all non-absolute paths would be cool. Something like require('node:test').setFileSnapshotDir('/my/path')
.
That would be easy to implement. My only concern would be that we already have |
This commit adds a t.assert.fileSnapshot() API to the test runner. This is similar to how snapshot tests work in core, as well as userland options such as toMatchFileSnapshot().
e76e07b
to
e80cc64
Compare
Rebased due to conflicts. Approval/re-approval requested. |
Landed in 19c8cc1 |
This commit adds a
t.assert.fileSnapshot()
API to the test runner. This is similar to how snapshot tests work in core, as well as userland options such astoMatchFileSnapshot()
.