Skip to content

Commit

Permalink
fix windows stat dir symlink
Browse files Browse the repository at this point in the history
  • Loading branch information
Caleb ツ Everett committed Jan 11, 2022
1 parent 0f74929 commit 7fc9416
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/lib/commands/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,16 @@ t.test('workspaces', async t => {
await npm.exec('copy', ['build'])
const canonPath = path.join('build', 'node_modules', 'a')
const linkPath = path.join('build', 'node_modules', 'c')

// if we stat the linkPath windows errors with EPERM, so I want to stat the
// link target, which means resolving relative links.
const linkDest = path.resolve(
path.dirname(linkPath),
fs.readlinkSync(linkPath))

t.strictSame(
fs.statSync(canonPath),
fs.statSync(linkPath),
fs.statSync(linkDest),
`${linkPath} should be a link to ${canonPath}`)
})
})
Expand Down

0 comments on commit 7fc9416

Please sign in to comment.