Skip to content

Commit 7fc9416

Browse files
committed
fix windows stat dir symlink
1 parent 0f74929 commit 7fc9416

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/lib/commands/copy.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,16 @@ t.test('workspaces', async t => {
172172
await npm.exec('copy', ['build'])
173173
const canonPath = path.join('build', 'node_modules', 'a')
174174
const linkPath = path.join('build', 'node_modules', 'c')
175+
176+
// if we stat the linkPath windows errors with EPERM, so I want to stat the
177+
// link target, which means resolving relative links.
178+
const linkDest = path.resolve(
179+
path.dirname(linkPath),
180+
fs.readlinkSync(linkPath))
181+
175182
t.strictSame(
176183
fs.statSync(canonPath),
177-
fs.statSync(linkPath),
184+
fs.statSync(linkDest),
178185
`${linkPath} should be a link to ${canonPath}`)
179186
})
180187
})

0 commit comments

Comments
 (0)