mirror of https://github.com/lukechilds/keyv-1.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
831 B
38 lines
831 B
#!/usr/bin/env node
|
|
|
|
'use strict'
|
|
|
|
const { spawnSync } = require('child_process')
|
|
const makeDir = require('make-dir')
|
|
const rimraf = require('rimraf')
|
|
const glob = require('glob')
|
|
const path = require('path')
|
|
|
|
const rooPath = path.resolve(__dirname, '..')
|
|
|
|
process.chdir(rooPath)
|
|
rimraf.sync('.nyc_output')
|
|
makeDir.sync('.nyc_output')
|
|
|
|
// Merge coverage data from each package so we can generate a complete report
|
|
glob.sync('packages/*/.nyc_output').forEach(nycOutput => {
|
|
const cwd = path.dirname(nycOutput)
|
|
const { status, stderr } = spawnSync(
|
|
'nyc',
|
|
[
|
|
'merge',
|
|
'.nyc_output',
|
|
path.join(rooPath, '.nyc_output', path.basename(cwd) + '.json')
|
|
],
|
|
{
|
|
encoding: 'utf8',
|
|
shell: true,
|
|
cwd
|
|
}
|
|
)
|
|
|
|
if (status !== 0) {
|
|
console.error(stderr)
|
|
process.exit(status)
|
|
}
|
|
})
|
|
|