Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function test(opts) {
const { expected, script, reporter } = opts
return new Task(function(complete) {
// Prepare
const expectedCleaned = expected.trim()
// Test Reporter
let output = ''
const env = { KAVA_REPORTER: reporter, ...process.env }
const args = [script, '--no-colors']
const str = args.join(' ')
process.stdout.write(sep(str.length, '=') + '\n' + str + '\n\n')
const runner = spawn('node', args, { env })
runner.stdout.on('data', function(data) {
output += data
process.stdout.write(data)
})
runner.stderr.on('data', function(data) {
output += data