-
-
Notifications
You must be signed in to change notification settings - Fork 148
/
test.js
31 lines (28 loc) · 783 Bytes
/
test.js
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
var fs = require('fs')
var tap = require('tap')
var dir = __dirname + '/test'
var node = process.execPath
var path = require('path')
var files = fs.readdirSync(dir)
var env = Object.keys(process.env).reduce(function (env, k) {
env[k] = process.env[k]
return env
}, {
TEST_GRACEFUL_FS_GLOBAL_PATCH: 1
})
tap.jobs = require('os').cpus().length
var testFiles = files.filter(function (f) {
return (/\.js$/.test(f) && fs.statSync(dir + '/' + f).isFile())
})
tap.plan(testFiles.length)
testFiles.forEach(function(f) {
tap.test(f, function(t) {
t.spawn(node, ['--expose-gc', 'test/' + f])
if (path.basename(f) !== 'monkeypatch-by-accident.js') {
t.spawn(node, ['--expose-gc', 'test/' + f], {
env: env
}, '🐵 test/' + f)
}
t.end()
})
})