Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests use cross-spawn-async instead of child_process.spawn #455

Merged
merged 2 commits into from Oct 8, 2015
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Next

tests use cross-spawn-async instead of child_process.spawn

This allows Windows to run the tests, as promised in
#429 (comment)

Note that there are a couple of outstanding failures on Windows:

    # client.seed: filesystem path to folder with one file, string
    not ok 8 should be equal
      ---
        operator: equal
        expected: '3a686c32404af0a66913dd5f8d2b40673f8d4490'
        actual:   'e6887b78d89d995876c7cef3476b6fb32c4c4e3d'
      ...
    not ok 9 should be equal
      ---
        operator: equal
        expected: |-
          'magnet:?xt=urn:btih:3a686c32404af0a66913dd5f8d2b40673f8d4490&dn=folder&tr=udp%3A%2F%2Ftracker.webtorrent.io%3A80'
        actual: |-
          'magnet:?xt=urn:btih:e6887b78d89d995876c7cef3476b6fb32c4c4e3d&dn=folder&tr=udp%3A%2F%2Ftracker.webtorrent.io%3A80'
  • Loading branch information
joseph-onsip committed Oct 5, 2015
commit 80d615b417e4c869b3cde4fec084f25e908aad1f
@@ -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)
})
@@ -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",
@@ -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 = []
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.