From: Feross Aboukhadijeh Date: Sun, 7 Dec 2014 19:44:09 +0000 (-0800) Subject: don't run browser tests in PRs X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=1b95f706b6e33b1e1177068766dc7cdb03555779;p=buffer.git don't run browser tests in PRs sauce labs credentials are not available on travis so tests will always fail. feross will run the tests manually before merging any PRs. --- diff --git a/bin/test.js b/bin/test.js new file mode 100644 index 0000000..33bb300 --- /dev/null +++ b/bin/test.js @@ -0,0 +1,18 @@ +#!/usr/bin/env node + +var cp = require('child_process') + +var runBrowserTests = !process.env.TRAVIS_PULL_REQUEST || + process.env.TRAVIS_PULL_REQUEST === 'false' + +var node = cp.spawn('npm', ['run', 'test-node'], { stdio: 'inherit' }) +node.on('close', function (code) { + if (runBrowserTests) { + var browser = cp.spawn('npm', ['run', 'test-browser'], { stdio: 'inherit' }) + browser.on('close', function (code) { + process.exit(code) + }) + } else { + process.exit(code) + } +}) diff --git a/package.json b/package.json index f563e7a..cad8d39 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "url": "git://github.com/feross/buffer.git" }, "scripts": { - "test": "npm run test-node && npm run test-browser", + "test": "node ./bin/test.js", "test-browser": "zuul -- test/*.js", "test-browser-local": "zuul --local -- test/*.js", "test-node": "tape test/*.js && OBJECT_IMPL=true tape test/*.js",