• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Flags: --expose-internals
2
3'use strict';
4
5require('../common');
6const assert = require('assert');
7
8assert.throws(
9  () => {
10    require('internal/bootstrap/loaders');
11  }, {
12    code: 'MODULE_NOT_FOUND',
13    message: /Cannot find module 'internal\/bootstrap\/loaders'/
14  }
15);
16
17assert.throws(
18  () => {
19    const source = 'module.exports = require("internal/bootstrap/loaders")';
20    const { internalBinding } = require('internal/test/binding');
21    internalBinding('natives').owo = source;
22    require('owo');
23  }, {
24    code: 'MODULE_NOT_FOUND',
25    message: /Cannot find module 'owo'/
26  }
27);
28