Skip to content

Commit

Permalink
fix test failures: avoid using execa (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli committed Dec 1, 2023
1 parent e782c09 commit 5dd6049
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions test/test-integration.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import * as path from 'path';
import { createHelpers } from 'yeoman-test';
import spawn from 'execa';
import * as cp from 'child_process';

import * as assert from 'assert';

Expand Down Expand Up @@ -115,9 +115,14 @@ describe('integration tests', function () {
});
});

async function doSpawn(execName, allArguments, options,) {
const resAudit = spawn(execName, allArguments, options)
resAudit.stdout.pipe(process.stdout);
resAudit.stderr.pipe(process.stderr);
return await resAudit;
async function doSpawn(execName, allArguments, options) {
return new Promise((resolve, reject) => {
const child = cp.spawn(execName, allArguments, { stdio: 'inherit', ...options });
child.on('error', (err) => {
reject(err);
});
child.on('exit', (exitCode) => {
resolve({ exitCode });
});
});
}

0 comments on commit 5dd6049

Please sign in to comment.