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

fix(message-utils): convert URLs to paths #12277

Merged
merged 7 commits into from
Feb 2, 2022
Merged

Conversation

mshima
Copy link
Contributor

@mshima mshima commented Jan 29, 2022

Summary

Workaround for tapjs/stack-utils#60

toMatchInlineSnapshot with mjs files causes the following error:

     Error: ENOENT: no such file or directory, open 'file:///Users/mshima/git/test/inline.mjs'
      at Object.openSync (node:fs:585:3)
      at readFileSync (node:fs:453:35)
      at saveSnapshotsForFile (node_modules/jest-snapshot/build/InlineSnapshots.js:127:22)
      at saveInlineSnapshots (node_modules/jest-snapshot/build/InlineSnapshots.js:116:5)
      at SnapshotState.save (node_modules/jest-snapshot/build/State.js:191:50)

Inspired by microsoft/playwright#10043.

Test plan

@facebook-github-bot
Copy link
Contributor

Hi @mshima!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@codecov-commenter
Copy link

codecov-commenter commented Jan 29, 2022

Codecov Report

Merging #12277 (20db7f6) into main (1614524) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #12277      +/-   ##
==========================================
- Coverage   67.53%   67.53%   -0.01%     
==========================================
  Files         328      328              
  Lines       17239    17241       +2     
  Branches     5064     5065       +1     
==========================================
+ Hits        11642    11643       +1     
- Misses       5564     5565       +1     
  Partials       33       33              
Impacted Files Coverage Δ
packages/jest-message-util/src/index.ts 86.26% <100.00%> (+0.15%) ⬆️
packages/expect/src/utils.ts 96.09% <0.00%> (-0.49%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a4339cb...20db7f6. Read the comment docs.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

Thanks! This needs a test and a changelog entry 🙂

packages/jest-message-util/src/index.ts Outdated Show resolved Hide resolved
@mshima mshima marked this pull request as draft January 30, 2022 14:32
@mshima mshima force-pushed the patch-1 branch 3 times, most recently from 6fb5556 to e983f90 Compare February 2, 2022 02:18
@mshima mshima marked this pull request as ready for review February 2, 2022 03:03
@mshima
Copy link
Contributor Author

mshima commented Feb 2, 2022

@SimenB thanks for the review.
Added a basic test and changelog entry.

@mshima mshima requested a review from SimenB February 2, 2022 03:24
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

thanks!

@SimenB
Copy link
Member

SimenB commented Feb 2, 2022

Wait, it's failing on Windows

@SimenB
Copy link
Member

SimenB commented Feb 2, 2022

Windows still unhappy 😞

@SimenB SimenB changed the title Return correct file path for mjs files. fix(message-utils): convert URLs to paths Feb 2, 2022
@SimenB SimenB merged commit 60a788e into jestjs:main Feb 2, 2022
@SimenB
Copy link
Member

SimenB commented Feb 2, 2022

Thank you!

@github-actions
Copy link

github-actions bot commented Mar 5, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants