diff options
-rw-r--r-- | bin/test.js | 6 | ||||
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | test/cmd.js | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/bin/test.js b/bin/test.js index 2fc368b..2675c80 100644 --- a/bin/test.js +++ b/bin/test.js @@ -1,14 +1,14 @@ #!/usr/bin/env node -var cp = require('child_process') +var spawn = require('cross-spawn-async') var runBrowserTests = !process.env.TRAVIS_PULL_REQUEST || process.env.TRAVIS_PULL_REQUEST === 'false' -var node = cp.spawn('npm', ['run', 'test-node'], { stdio: 'inherit' }) +var node = spawn('npm', ['run', 'test-node'], { stdio: 'inherit' }) node.on('close', function (code) { if (code === 0 && runBrowserTests) { - var browser = cp.spawn('npm', ['run', 'test-browser'], { stdio: 'inherit' }) + var browser = spawn('npm', ['run', 'test-browser'], { stdio: 'inherit' }) browser.on('close', function (code) { process.exit(code) }) diff --git a/package.json b/package.json index a14cf99..25f4e3d 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "chunk-store-stream": "^2.0.0", "clivas": "^0.2.0", "create-torrent": "^3.4.0", + "cross-spawn-async": "^2.0.0", "debug": "^2.1.0", "end-of-stream": "^1.0.0", "executable": "^1.1.0", diff --git a/test/cmd.js b/test/cmd.js index abba4c2..ee8a87b 100644 --- a/test/cmd.js +++ b/test/cmd.js @@ -1,4 +1,5 @@ var cp = require('child_process') +var spawn = require('cross-spawn-async') var path = require('path') var fs = require('fs') var parseTorrent = require('parse-torrent') @@ -84,7 +85,7 @@ test('Command line: webtorrent create /path/to/file', function (t) { var leavesPath = path.resolve(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub') - var child = cp.spawn('node', [ CMD_PATH, 'create', leavesPath ]) + var child = spawn('node', [ CMD_PATH, 'create', leavesPath ]) child.on('error', function (err) { t.fail(err) }) var chunks = [] |