Commit 4f21cf11 by Adeel

Code: Saves extra nesting.

parent 7bb7ba0d
...@@ -119,41 +119,43 @@ function testBinary(options) { ...@@ -119,41 +119,43 @@ function testBinary(options) {
return build(options); return build(options);
} }
if (!process.env.SKIP_NODE_SASS_TESTS) { if (process.env.SKIP_NODE_SASS_TESTS) {
fs.stat(path.join(__dirname, '..', 'vendor', options.bin, 'binding.node'), function (err) { return;
if (err) { }
return build(options);
}
console.log('`' + options.bin + '` exists; testing'); fs.stat(path.join(__dirname, '..', 'vendor', options.bin, 'binding.node'), function (err) {
if (err) {
return build(options);
}
var total; console.log('`' + options.bin + '` exists; testing');
var failures;
var mocha = new Mocha({ var total;
ui: 'bdd', var failures;
timeout: 999999, var mocha = new Mocha({
reporter: function(stats) { ui: 'bdd',
total = stats.total; timeout: 999999,
failures = stats.failures; reporter: function(stats) {
} total = stats.total;
}); failures = stats.failures;
}
});
mocha.addFile(path.resolve(__dirname, '..', 'test', 'api.js')); mocha.addFile(path.resolve(__dirname, '..', 'test', 'api.js'));
mocha.run(function () { mocha.run(function () {
if ((total - failures) * 100 / total < 90) { if ((total - failures) * 100 / total < 90) {
console.log([ console.log([
'Problem with the binary: ' + failures + ' of ' + total + ' tests are failing.', 'Problem with the binary: ' + failures + ' of ' + total + ' tests are failing.',
'Manual build incoming.', 'Manual build incoming.',
'Please consider contributing the release binary to https://github.com/sass/node-sass-binaries for npm distribution.' 'Please consider contributing the release binary to https://github.com/sass/node-sass-binaries for npm distribution.'
].join('\n')); ].join('\n'));
return build(options); return build(options);
} }
console.log('Binary is fine; exiting'); console.log('Binary is fine; exiting');
});
}); });
} });
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment