From 5b5e4dc6049641f672167d6c748ea5c7ff3baf3e Mon Sep 17 00:00:00 2001 From: Adeel Date: Thu, 8 Jan 2015 21:29:47 +0200 Subject: [PATCH] Build: Use grep to filter test cases. * Uses different strategy to test binary. * Test two cases and declare the binary OK. Issue URL: #611. --- scripts/build.js | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index 7c38d92a1..55154821c 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -115,10 +115,6 @@ function testBinary(options) { return build(options); } - if (process.env.SKIP_NODE_SASS_TESTS) { - return; - } - fs.stat(path.join(__dirname, '..', 'vendor', options.bin, 'binding.node'), function (err) { if (err) { return build(options); @@ -126,22 +122,16 @@ function testBinary(options) { console.log('`' + options.bin + '` exists; testing'); - var total; - var failures; var mocha = new Mocha({ ui: 'bdd', - timeout: 999999, - reporter: function(stats) { - total = stats.total; - failures = stats.failures; - } + timeout: 999999 }); mocha.addFile(path.resolve(__dirname, '..', 'test', 'api.js')); - mocha.run(function () { - if ((total - failures) * 100 / total < 90) { + mocha.grep(/should compile sass to css with file/).run(function (done) { + if (done !== 0) { console.log([ - 'Problem with the binary: ' + failures + ' of ' + total + ' tests are failing.', + 'Problem with the binary.', 'Manual build incoming.', 'Please consider contributing the release binary to https://github.com/sass/node-sass-binaries for npm distribution.' ].join('\n'));