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

Error locations are already converted from URLs to paths by Jest #55

Merged
merged 1 commit into from Aug 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/worker-runner.js
Expand Up @@ -86,11 +86,6 @@ export default async function run({
await runTestBlock(tests, hasFocusedTests, testNamePatternRE, results, stats);
stats.end = performance.now();

snapshotState._inlineSnapshots.forEach(({ frame }) => {
// When using native ESM, errors have a URL location.
// Jest expects paths.
frame.file = fileURLToPath(frame.file);
Copy link
Contributor

Choose a reason for hiding this comment

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

If by any chance frame.file could be a URL, we can test if frame.file starts with file:// and then apply the transform.

Copy link
Owner Author

Choose a reason for hiding this comment

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

It was probably for an older Jest 27 version, we can just bump the peer dep requirement.

Copy link
Contributor

Choose a reason for hiding this comment

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

jestjs/jest#12277, so 27.5 can be minimum if you don't wanna leave 27 behind 🙂

Copy link
Owner Author

Choose a reason for hiding this comment

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

Thank you!

});
snapshotState.save();

// Restore the project-level serializers, so that serializers
Expand Down