Skip to content

Commit 8d79000

Browse files
committed
test: configure proper devDir for invoking configure()
test/test-configure-python.js downloads a fresh set of headers to the package directory each time. By setting to the default global cache dir we get to re-use cached headers and skip the download step.
1 parent c0282da commit 8d79000

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

test/common.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const envPaths = require('env-paths')
2+
3+
module.exports.devDir = () => envPaths('node-gyp', { suffix: '' }).cache

test/test-configure-python.js

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ test('configure PYTHONPATH with no existing env', function (t) {
3030
t.equal(process.env.PYTHONPATH, EXPECTED_PYPATH)
3131
return SPAWN_RESULT
3232
}
33+
prog.devDir = devDir
3334
configure(prog, [], t.fail)
3435
})
3536

@@ -49,6 +50,7 @@ test('configure PYTHONPATH with existing env of one dir', function (t) {
4950

5051
return SPAWN_RESULT
5152
}
53+
prog.devDir = devDir
5254
configure(prog, [], t.fail)
5355
})
5456

@@ -70,5 +72,6 @@ test('configure PYTHONPATH with existing env of multiple dirs', function (t) {
7072

7173
return SPAWN_RESULT
7274
}
75+
prog.devDir = devDir
7376
configure(prog, [], t.fail)
7477
})

0 commit comments

Comments
 (0)