From 4029fa862990a346a28ee29cc9335d43fe23ee7c Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Sun, 23 Jun 2019 15:31:52 +1000 Subject: [PATCH] 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. PR-URL: https://github.com/nodejs/node-gyp/pull/1796 Reviewed-By: Richard Lau --- test/common.js | 3 +++ test/test-configure-python.js | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 test/common.js diff --git a/test/common.js b/test/common.js new file mode 100644 index 0000000000..b714ee2902 --- /dev/null +++ b/test/common.js @@ -0,0 +1,3 @@ +const envPaths = require('env-paths') + +module.exports.devDir = () => envPaths('node-gyp', { suffix: '' }).cache diff --git a/test/test-configure-python.js b/test/test-configure-python.js index 518bf036d0..f28234134f 100644 --- a/test/test-configure-python.js +++ b/test/test-configure-python.js @@ -30,6 +30,7 @@ test('configure PYTHONPATH with no existing env', function (t) { t.equal(process.env.PYTHONPATH, EXPECTED_PYPATH) return SPAWN_RESULT } + prog.devDir = devDir configure(prog, [], t.fail) }) @@ -49,6 +50,7 @@ test('configure PYTHONPATH with existing env of one dir', function (t) { return SPAWN_RESULT } + prog.devDir = devDir configure(prog, [], t.fail) }) @@ -70,5 +72,6 @@ test('configure PYTHONPATH with existing env of multiple dirs', function (t) { return SPAWN_RESULT } + prog.devDir = devDir configure(prog, [], t.fail) })