node/test/parallel/test-internal-modules.js
Ali Ijaz Sheikh a02e3e2d5f lib: improve error message for MODULE_NOT_FOUND
Include the require stack in the reported error message.

PR-URL: https://github.com/nodejs/node/pull/25690
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-15 12:52:05 -08:00

14 lines
308 B
JavaScript

'use strict';
require('../common');
const fixtures = require('../common/fixtures');
const assert = require('assert');
assert.throws(function() {
require('internal/freelist');
}, /^Error: Cannot find module 'internal\/freelist'/);
assert.strictEqual(
require(fixtures.path('internal-modules')),
42
);