summaryrefslogtreecommitdiff
path: root/test/es-module/test-esm-loader-search.js
blob: 0ca8990cb723ad4fc5d2c042d054df29642eb1d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'use strict';
// Flags: --expose-internals

// This test ensures that search throws errors appropriately

const common = require('../common');

const { search } = require('internal/modules/esm/default_resolve');

common.expectsError(
  () => search('target', undefined),
  {
    code: 'ERR_MISSING_MODULE',
    type: Error,
    message: 'Cannot find module target'
  }
);