Skip to content

Commit 8710438

Browse files
committed
Work around Node 0.10 Windows flake when testing
1 parent 26d337a commit 8710438

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/integration/glob.spec.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,22 @@ var testGlob = {
7777
shouldFail: execMochaWith(function shouldFailWithStderr (error, stderr) { expect(error && error.message).to.contain(stderr); })
7878
};
7979

80+
var isFlakeyNode = (function () {
81+
var version = process.versions.node.split('.');
82+
return version[0] === '0' && version[1] === '10' && process.platform === 'win32';
83+
}());
84+
8085
function execMochaWith (validate) {
8186
return function execMocha (glob, assertOn, done) {
8287
exec(node + ' "' + path.join('..', '..', '..', '..', 'bin', 'mocha') + '" -R json-stream ' + glob, { cwd: path.join(__dirname, 'fixtures', 'glob') }, function (error, stdout, stderr) {
8388
try {
8489
validate(error, stderr);
85-
assertOn({ stdout: stdout, stderr: stderr });
86-
done();
90+
if (isFlakeyNode && error && (stderr === '')) {
91+
execMocha(glob, assertOn, done);
92+
} else {
93+
assertOn({ stdout: stdout, stderr: stderr });
94+
done();
95+
}
8796
} catch (assertion) {
8897
done(assertion);
8998
}

0 commit comments

Comments
 (0)