You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

21 lines
566 B

'use strict';
require('../common');
if (process.argv[2] === 'async') {
async function fn() {
fn();
throw new Error();
}
(async function() { await fn(); })();
// While the above should error, just in case it dosn't the script shouldn't
// fork itself indefinitely so return early.
return;
}
const assert = require('assert');
const { spawnSync } = require('child_process');
const ret = spawnSync(process.execPath, [__filename, 'async']);
assert.strictEqual(ret.status, 0);
assert.ok(!/async.*hook/i.test(ret.stderr.toString('utf8', 0, 1024)));