File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -138,9 +138,11 @@ test('resolvePackageManagerPath returns the absolute path of a launcher found on
138138 fs . writeFileSync ( launcher , '' ) ;
139139 withEnv ( { PATH : dir , PATHEXT : '.COM;.EXE;.BAT;.CMD' } , ( ) => {
140140 const resolved = resolvePackageManagerPath ( 'npm' ) ;
141- // On Windows the returned extension casing follows PATHEXT (.CMD) while the
142- // file is npm.cmd; both refer to the same file on a case-insensitive FS.
143- assert . equal ( resolved ?. toLowerCase ( ) , launcher . toLowerCase ( ) ) ;
141+ // resolvePackageManagerPath calls fs.realpathSync.native to collapse 8.3 short
142+ // names and symlinks; CI runners ship TEMP as a short path (RUNNER~1) so the
143+ // expected value must go through the same canonicalisation.
144+ const expected = fs . realpathSync . native ( launcher ) ;
145+ assert . equal ( resolved ?. toLowerCase ( ) , expected . toLowerCase ( ) ) ;
144146 } ) ;
145147 } finally {
146148 fs . rmSync ( dir , { recursive : true , force : true } ) ;
You can’t perform that action at this time.
0 commit comments