summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/request/tests/run.js
blob: f3a30d3541431edc81293af49a1d3e2ae34f28b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var spawn = require('child_process').spawn
  , exitCode = 0
  ;

var tests = [
    'test-body.js'
  , 'test-cookie.js'
  , 'test-cookiejar.js'
  , 'test-defaults.js'
  , 'test-errors.js'
  , 'test-headers.js'
  , 'test-httpModule.js'
  , 'test-https.js'
  , 'test-https-strict.js'
  , 'test-oauth.js'
  , 'test-pipes.js'
  , 'test-pool.js'
  , 'test-proxy.js'
  , 'test-qs.js'
  , 'test-redirect.js'
  , 'test-timeout.js'
  , 'test-toJSON.js'
  , 'test-tunnel.js'
] 

var next = function () {
  if (tests.length === 0) process.exit(exitCode);
  
  var file = tests.shift()
  console.log(file)
  var proc = spawn('node', [ 'tests/' + file ])
  proc.stdout.pipe(process.stdout)
  proc.stderr.pipe(process.stderr)
  proc.on('exit', function (code) {
  	exitCode += code || 0
  	next()
  })
}
next()