Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

test: make snapshot path stripping CWD-agnostic #61351

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

Open
emicovi wants to merge 1 commit into nodejs:main
base: main
Choose a base branch
Loading
from emicovi:fix/test-cwd-agnostic-snapshots

Conversation

@emicovi
Copy link

@emicovi emicovi commented Jan 12, 2026

transformProjectRoot() now strips the project root only when it is a real path prefix, avoiding accidental matches inside tokens like 'node_modules' or URLs when the repository lives in paths such as '/node'.

Also update the node output snapshot tests to use transformProjectRoot(), make permission deny tests handle running from the filesystem root, and relax import.meta path regexes for the same scenario.

Add a regression test for transformProjectRoot().

Refs: #61303

@nodejs-github-bot nodejs-github-bot added esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Jan 12, 2026
Copy link

codecov bot commented Jan 12, 2026
edited
Loading

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.51%. Comparing base (1bd7f62) to head (1afa7df).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@
## main #61351 +/- ##
==========================================
- Coverage 88.51% 88.51% -0.01% 
==========================================
 Files 704 704 
 Lines 208739 208739 
 Branches 40274 40279 +5 
==========================================
- Hits 184770 184767 -3 
- Misses 15968 15970 +2 
- Partials 8001 8002 +1 

see 26 files with indirect coverage changes

🚀 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.

transformProjectRoot() now strips the project root only when it is a
real path prefix, avoiding accidental matches inside tokens like
'node_modules' or URLs when the repository lives in paths such as
'/node'.
Also update the node output snapshot tests to use
transformProjectRoot(), make permission deny tests handle running from
the filesystem root, and relax import.meta path regexes for the same
scenario.
Add a regression test for transformProjectRoot().
Refs: nodejs#61303 
@emicovi emicovi force-pushed the fix/test-cwd-agnostic-snapshots branch from 1afa7df to fc94c8c Compare January 15, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /