We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e5a223c commit 24b8bdaCopy full SHA for 24b8bda
test/path-reservations.js
@@ -3,11 +3,15 @@ const t = require('tap')
3
// load up the posix and windows versions of the reserver
4
if (process.platform === 'win32')
5
process.env.TESTING_TAR_FAKE_PLATFORM = 'posix'
6
-const { reserve } = require('../lib/path-reservations.js')()
+const { reserve } = t.mock('../lib/path-reservations.js', {
7
+ path: require('path').posix,
8
+})()
9
delete process.env.TESTING_TAR_FAKE_PLATFORM
10
if (process.platform !== 'win32')
11
process.env.TESTING_TAR_FAKE_PLATFORM = 'win32'
-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
15
16
t.test('basic race', t => {
17
// simulate the race conditions we care about
0 commit comments