Skip to content

Commit 8db7fd3

Browse files
committed
fix(test): assert normalized callback dest in extractPackage test
extractPackage now hands the callback a forward-slash-normalized dest, so the 'should call callback with destination path' test must compare against normalizePath(dest) — the raw path.join() dest is backslash-separated on Windows and the string-equality assertion failed there.
1 parent e45d99a commit 8db7fd3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/unit/packages/operations.network.test.mts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ describeNetworkOnly('extractPackage', () => {
5252
'should call callback with destination path',
5353
async () => {
5454
await runWithTempDir(async tmpDir => {
55-
const dest = path.join(tmpDir, 'extracted')
55+
// extractPackage normalizes the dest to forward slashes before handing
56+
// it to pacote + the callback, so assert against the normalized form
57+
// (a raw path.join() dest is backslash-separated on Windows).
58+
const dest = normalizePath(path.join(tmpDir, 'extracted'))
5659
await fs.mkdir(dest, { recursive: true })
5760

5861
let callbackPath = ''

0 commit comments

Comments
 (0)