Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Build: Uses different strategy to test bins status
Browse files Browse the repository at this point in the history
Only 90% of the test should pass.
  • Loading branch information
am11 committed Oct 29, 2014
1 parent 5f275e7 commit 49e6892
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,21 @@ if (!force && !process.env.SKIP_NODE_SASS_TESTS) {
fs.statSync(path.join(__dirname, 'bin', modPath, 'binding.node'));
console.log('`'+ modPath+ '` exists; testing');

var total, failures;
var mocha = new Mocha({
reporter: 'dot',
reporter: function (stats) {
total = stats.total;
failures = stats.failures;
},
ui: 'bdd',
timeout: 999999
});

mocha.addFile(path.resolve(__dirname, 'test', 'test.js'));

mocha.run(function (done) {
if (done !== 0) {
mocha.run(function () {
// at least 90% of tests should pass
if ((total - failures) * 100 / total < 90) {
console.log('Problem with the binary; manual build incoming');
console.log('Please consider contributing the release binary to https://github.com/sass/node-sass-binaries for npm distribution.');
build();
Expand Down

0 comments on commit 49e6892

Please sign in to comment.