Skip to content

Commit fb50e29

Browse files
author
Dane Springmeyer
committedFeb 17, 2015
attemp to workaround nodejs/node#751 - refs #147
1 parent 08b0018 commit fb50e29

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed
 

‎test/build.test.js

+24-7
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ var apps = [
6161
}
6262
];
6363

64+
function detectIOJS(current_version) {
65+
var current_parts = current_version.split('.').map(function(i) { return +i; });
66+
if (current_parts[0] == 1) return true;
67+
return false;
68+
}
69+
70+
var is_iojs = detectIOJS(process.version.replace('v',''));
6471

6572
function getPreviousVersion(current_version) {
6673
var current_parts = current_version.split('.').map(function(i) { return +i; });
@@ -270,14 +277,24 @@ describe('build', function() {
270277
});
271278

272279
it(app.name + ' passes tests ' + app.args, function(done) {
273-
run('npm','test','', app, {env : process.env, cwd: path.join(__dirname,app.name)}, function(err,stdout,stderr) {
274-
if (err) return on_error(err,stdout,stderr);
275-
if (stderr.indexOf("child_process: customFds option is deprecated, use stdio instead") == -1) {
280+
// work around https://github.com/iojs/io.js/issues/751
281+
if (is_iojs && process.platform === 'win32') {
282+
run('iojs','index.js','', app, {env : process.env, cwd: path.join(__dirname,app.name)}, function(err,stdout,stderr) {
283+
if (err) return on_error(err,stdout,stderr);
276284
assert.equal(stderr,'');
277-
}
278-
assert.notEqual(stdout,'');
279-
done();
280-
});
285+
assert.equal(stdout,'');
286+
done();
287+
});
288+
} else {
289+
run('npm','test','', app, {env : process.env, cwd: path.join(__dirname,app.name)}, function(err,stdout,stderr) {
290+
if (err) return on_error(err,stdout,stderr);
291+
if (stderr.indexOf("child_process: customFds option is deprecated, use stdio instead") == -1) {
292+
assert.equal(stderr,'');
293+
}
294+
assert.notEqual(stdout,'');
295+
done();
296+
});
297+
}
281298
});
282299

283300
it(app.name + ' packages ' + app.args, function(done) {

0 commit comments

Comments
 (0)