mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-19 23:17:16 +03:00
Simpler way of running tests
This commit is contained in:
parent
a61fd8cd1a
commit
3953211985
21
script/run-package-tests.js
Normal file
21
script/run-package-tests.js
Normal 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"
|
||||
})
|
Loading…
Reference in New Issue
Block a user