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.
 
 
 
 
 
 

22 lines
530 B

'use strict';
// Used to test the `uncaughtException` err object
const assert = require('assert');
const { callbackify } = require('util');
{
const sentinel = new Error(__filename);
process.once('uncaughtException', (err) => {
assert.strictEqual(err, sentinel);
// Calling test will use `stdout` to assert value of `err.message`
console.log(err.message);
});
async function fn() {
return await Promise.reject(sentinel);
}
const cbFn = callbackify(fn);
cbFn((err, ret) => assert.ifError(err));
}