test: fix "crash cases" tests not failing properly (#37304)

* test: fix "crash cases" tests not failing properly

* fixup! test: fix "crash cases" tests not failing properly
This commit is contained in:
Alexey Kuzmin 2023-02-17 10:14:00 +01:00 committed by GitHub
parent ea848bc1c5
commit 73b7aac6a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 12 deletions

View file

@ -62,10 +62,10 @@ describe('modules support', () => {
ifit(features.isRunAsNodeEnabled())('can be required in node binary', async function () {
const child = childProcess.fork(path.join(fixtures, 'module', 'uv-dlopen.js'));
await new Promise<void>(resolve => child.once('exit', (exitCode) => {
expect(exitCode).to.equal(0);
resolve();
const exitCode = await new Promise<number | null>(resolve => child.once('exit', (exitCode) => {
resolve(exitCode);
}));
expect(exitCode).to.equal(0);
});
});