blob: 55e2e5368d7d1754fa1a60ba266b1b7faa8e7fbc [file] [edit]
'use strict';
const common = require('../common');
const assert = require('assert');
(function foobar() {
require('domain');
})();
assert.throws(
() => process.setUncaughtExceptionCaptureCallback(common.mustNotCall()),
(err) => {
common.expectsError(
{
code: 'ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE',
name: 'Error',
message: /^The `domain` module is in use, which is mutually/
}
)(err);
assert(err.stack.includes('-'.repeat(40)),
`expected ${err.stack} to contain dashes`);
const location = `at foobar (${__filename}:`;
assert(err.stack.includes(location),
`expected ${err.stack} to contain ${location}`);
return true;
}
);