-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Expose snapshot directory through test.meta #2444
Changes from all commits
d9723d8
2ae1e64
e5dc8b0
0e90020
3861b14
7ec16e1
3eefd81
86d3a3d
24aa738
d324507
5f89a13
72182da
31219da
c164be8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
const {default: test, meta} = require('../..'); | ||
|
||
test('meta is test.meta', t => { | ||
t.is(meta, test.meta); | ||
}); | ||
Comment on lines
+3
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this test necessary? I added it to not have to add two tests for every property as was done for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess it won't hurt 😄 I'm looking to remove this extra export in #2435. |
||
|
||
test('meta.file', t => { | ||
t.is(meta.file, __filename); | ||
}); | ||
|
||
test('test.meta.file', t => { | ||
t.is(test.meta.file, __filename); | ||
test('meta.snapshotDirectory', t => { | ||
t.regex(meta.snapshotDirectory, /snapshot-fixture/); | ||
}); | ||
|
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.
Note: In order to not have to export both
determineSnapshotDir()
andresolveSourceFile()
I changed the signature ofdetermineSnapshotDir()
to take the "raw" file instead of the source file (it resolves the source file on its own).Caveat:
resolveSourceFile()
is called twice forload()
(once more to determine the relative path). But since it's memoized, I think it should be fine, no?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.
I think that's fine.