Skip to content

Commit

Permalink
test: configure proper devDir for invoking configure()
Browse files Browse the repository at this point in the history
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: #1796
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
rvagg committed Nov 18, 2019
1 parent fe8b02c commit 4029fa8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const envPaths = require('env-paths')

module.exports.devDir = () => envPaths('node-gyp', { suffix: '' }).cache
3 changes: 3 additions & 0 deletions test/test-configure-python.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

Expand All @@ -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)
})

Expand All @@ -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)
})

0 comments on commit 4029fa8

Please sign in to comment.