forked from cakrayp/ssweb-api-caliph
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.js
27 lines (27 loc) · 932 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
let fs = require('fs')
let path = require('path')
let assert = require('assert')
let { spawn } = require('child_process')
let folders = ['.', ...Object.keys(require('./package.json').directories)]
let files = []
console.log('framework', {
version: process.version,
platform: process.platform,
arch: process.arch,
release: process.release,
execPath: process.execPath
});
console.log('Starting with command', `"${process.argv0}" (${process.version})`)
for (let folder of folders)
for (let file of fs.readdirSync(folder).filter(v => v.endsWith('.js')))
files.push(path.resolve(path.join(folder, file)))
for (let file of files) {
if (file == path.join(__dirname, __filename)) continue
console.error('Checking', file)
spawn(process.argv0, ['-c', file])
.on('close', () => {
assert.ok(file)
console.log('Done', file)
})
.stderr.on('data', chunk => assert.ok(chunk.length < 1, file + '\n\n' + chunk))
}