Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

fix: symlink on win32 platform without admin rights #162

Closed
wants to merge 4 commits into from

Conversation

salvoravida
Copy link

References

@salvoravida
Copy link
Author

fix npm7 workspaces symlink on win32

npm/cli#1923

@RoystonS
Copy link

I think those builds are failing because 100% test coverage isn't being achieved? That's going to be a hard bar to reach when running tests on Linux and macOS (or any single OS) for a conditional where one side only fires on a different OS (Windows in this case).

@salvoravida
Copy link
Author

salvoravida commented Oct 28, 2020

return symlink(rel, node.path, process.platform==="win32" ? 'junction' : 'dir')

i do not expect that any test fails on linux OS, as that change has no effect.

@RoystonS
Copy link

RoystonS commented Oct 28, 2020

I don't believe that the test is failing, but that, because the Windows-only path isn't executed, coverage has dropped <100%, so the build is failing because of that.

It says:

ERROR: Coverage for branches (99.96%) does not meet global threshold (100%)

@philipparndt
Copy link

I've added some test cases for this in salvoravida#1
To be able to test this I've extracted a linktype function

linktype (platform = process.platform) {
  return platform === 'win32' ? 'junction' : 'dir'
}

@salvoravida
Copy link
Author

@philipparndt great!

@isaacs
Copy link
Contributor

isaacs commented Nov 6, 2020

Addressed by #175, no need to check the platform, since the third argument is ignored on posix systems. Thanks!

@isaacs isaacs closed this Nov 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants