From a83a3801fc6fd955226a33f424f1052174018d0e Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Mon, 27 Feb 2017 12:21:49 -0500 Subject: [PATCH] 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 Reviewed-By: Gibson Fahnestock Reviewed-By: Michael Dawson --- test/test-configure-python.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/test-configure-python.js b/test/test-configure-python.js index 2930cacffc..f235bdbba1 100644 --- a/test/test-configure-python.js +++ b/test/test-configure-python.js @@ -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) })