* Runs a sample and returns its output * * @param {string} sample name of sample to run. No need for '.js' suffix. * @param {string[]} args the arguments to pass to the sample * @returns {string} output of the command
(sample, args = [])
| 27 | * @returns {string} output of the command |
| 28 | */ |
| 29 | async function runSample(sample, args = []) { |
| 30 | return execFileSync('node', [`${sample}.js`, ...args], { |
| 31 | encoding: 'utf-8', |
| 32 | cwd: path.join(__dirname, '..', '..'), |
| 33 | }); |
| 34 | } |
| 35 | |
| 36 | module.exports = { |
| 37 | runSample, |
no outgoing calls
no test coverage detected