1'use strict'; 2const common = require('../common'); 3const assert = require('assert'); 4 5process.setUncaughtExceptionCaptureCallback(common.mustNotCall()); 6 7assert.throws( 8 () => require('domain'), 9 { 10 code: 'ERR_DOMAIN_CALLBACK_NOT_AVAILABLE', 11 name: 'Error', 12 message: /^A callback was registered.*with using the `domain` module/ 13 } 14); 15 16process.setUncaughtExceptionCaptureCallback(null); 17require('domain'); // Should not throw. 18