Skip to content

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
@codecov
Copy link

codecov bot commented Jan 12, 2026

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

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

Development

Successfully merging this pull request may close these issues.

2 participants