29 lines
555 B
JavaScript
Raw Normal View History

'use strict'
const path = require('path')
const execa = require('execa')
2021-08-16 21:29:06 +02:00
const { toString: uint8ArrayToString } = require('uint8arrays/to-string')
async function test() {
process.stdout.write('2.js\n')
const proc = execa('node', [path.join(__dirname, '2.js')], {
cwd: path.resolve(__dirname),
all: true
})
let output = ''
proc.all.on('data', async (data) => {
process.stdout.write(data)
output += uint8ArrayToString(data)
if (output.includes('Found provider:')) {
proc.kill()
}
})
}
module.exports = test