nodejs/test/parallel/test-domain-load-after-set-uncaught-exception-capture.js

19 lines
450 B
JavaScript
Raw Normal View History

'use strict';
const common = require('../common');
const assert = require('assert');
process.setUncaughtExceptionCaptureCallback(common.mustNotCall());
common.expectsError(
() => require('domain'),
{
code: 'ERR_DOMAIN_CALLBACK_NOT_AVAILABLE',
type: Error,
message: /^A callback was registered.*with using the `domain` module/
}
);
process.setUncaughtExceptionCaptureCallback(null);
assert.doesNotThrow(() => require('domain'));