Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test.js « bin - github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b30a701fea8cfb2ec99f36e408fa8da6e7551041 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env node

var spawn = require('cross-spawn-async')

var runSauceLabs = process.env.SAUCE_USERNAME && process.env.SAUCE_ACCESS_KEY

npmRun('test-node', function (code) {
  if (code === 0) {
    var scriptName = runSauceLabs ? 'test-browser' : 'test-browser-headless'
    npmRun(scriptName, function (code) {
      process.exit(code)
    })
  } else {
    process.exit(code)
  }
})

function npmRun (scriptName, onClose) {
  spawn('npm', ['run', scriptName], { stdio: 'inherit' }).on('close', onClose)
}