UNPKG

test-executor

Version:

Executes test scripts in the specified dirs.

17 lines (14 loc) 458 B
'use strict' const spawn = require('child_process').spawn module.exports = (process, format, callback) => { const testCoverage = spawn('./node_modules/.bin/nyc', ['report', '--reporter', format], { stdio: [process.stdin, process.stdout, process.stderr] }) testCoverage.on('close', (code) => { if (code === 0) { callback(null, process) } else { callback(new Error(`test coverage report failed with code ${code}`)) } }) }