Simpler way of running tests

This commit is contained in:
Maurício Szabo 2022-08-12 20:16:19 -03:00
parent a61fd8cd1a
commit 3953211985

View File

@ -0,0 +1,21 @@
const cp = require('child_process')
const fs = require('fs')
const path = require('path')
const packJson = require('../package.json')
let packagePath = []
for(let pack in packJson.packageDependencies) {
if(pack.match(/language|autocomplete/)) {
let basePath = path.join('node_modules', pack)
let testPath = path.join(basePath, 'test')
let specPath = path.join(basePath, 'spec')
if(fs.existsSync(testPath)) packagePath.push(testPath)
if(fs.existsSync(specPath)) packagePath.push(specPath)
}
}
cp.spawnSync('yarn', ['start', '--test', ...packagePath], {
cwd: process.cwd(),
detached: true,
stdio: "inherit"
})