Skip to content

Commit

Permalink
test: fix test/test-configure-python on AIX
Browse files Browse the repository at this point in the history
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: #1131
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
richardlau authored and gibfahn committed Apr 25, 2017
1 parent 8a76714 commit a83a380
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/test-configure-python.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {}) }
}
Expand All @@ -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) {
Expand All @@ -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) {
Expand All @@ -68,5 +70,5 @@ test('configure PYTHONPATH with existing env of multiple dirs', function (t) {

return SPAWN_RESULT
}
configure(prog, [])
configure(prog, [], t.fail)
})

0 comments on commit a83a380

Please sign in to comment.