Skip to content

Commit 24b8bda

Browse files
committed
fix(test): use posix path for testing path reservations
1 parent e5a223c commit 24b8bda

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/path-reservations.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ const t = require('tap')
33
// load up the posix and windows versions of the reserver
44
if (process.platform === 'win32')
55
process.env.TESTING_TAR_FAKE_PLATFORM = 'posix'
6-
const { reserve } = require('../lib/path-reservations.js')()
6+
const { reserve } = t.mock('../lib/path-reservations.js', {
7+
path: require('path').posix,
8+
})()
79
delete process.env.TESTING_TAR_FAKE_PLATFORM
810
if (process.platform !== 'win32')
911
process.env.TESTING_TAR_FAKE_PLATFORM = 'win32'
10-
const { reserve: winReserve } = t.mock('../lib/path-reservations.js')()
12+
const { reserve: winReserve } = t.mock('../lib/path-reservations.js', {
13+
path: require('path').win32,
14+
})()
1115

1216
t.test('basic race', t => {
1317
// simulate the race conditions we care about

0 commit comments

Comments
 (0)