test: fix test/test-configure-python on AIX

On AIX, lib/configure.js attempts to locate node.exp via calls to
fs.openSync() and fs.closeSync(). Add these functions to the mocked
`graceful-fs` object in test/test-configure-python.js.

PR-URL: https://github.com/nodejs/node-gyp/pull/1131
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This commit is contained in:
Richard Lau 2017-02-27 12:21:49 -05:00 committed by Gibson Fahnestock
parent 8a767145c9
commit a83a3801fc
No known key found for this signature in database
GPG key ID: B01FBB92821C587A

View file

@ -6,6 +6,8 @@ var gyp = require('../lib/node-gyp')
var requireInject = require('require-inject')
var configure = requireInject('../lib/configure', {
'graceful-fs': {
'openSync': function (file, mode) { return 0; },
'closeSync': function (fd) { },
'writeFile': function (file, data, cb) { cb() },
'stat': function (file, cb) { cb(null, {}) }
}
@ -26,7 +28,7 @@ test('configure PYTHONPATH with no existing env', function (t) {
t.equal(process.env.PYTHONPATH, EXPECTED_PYPATH)
return SPAWN_RESULT
}
configure(prog, [])
configure(prog, [], t.fail)
})
test('configure PYTHONPATH with existing env of one dir', function (t) {
@ -46,7 +48,7 @@ test('configure PYTHONPATH with existing env of one dir', function (t) {
return SPAWN_RESULT
}
configure(prog, [])
configure(prog, [], t.fail)
})
test('configure PYTHONPATH with existing env of multiple dirs', function (t) {
@ -68,5 +70,5 @@ test('configure PYTHONPATH with existing env of multiple dirs', function (t) {
return SPAWN_RESULT
}
configure(prog, [])
configure(prog, [], t.fail)
})