0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
nodejs/test/es-module/test-esm-loader-search.js
Gus Caplan 921fb84687 module: refactor loader
PR-URL: https://github.com/nodejs/node/pull/16874
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
2018-01-15 12:42:29 -06:00

19 lines
416 B
JavaScript

'use strict';
// Flags: --expose-internals
// This test ensures that search throws errors appropriately
const common = require('../common');
const { search } = require('internal/loader/DefaultResolve');
const errors = require('internal/errors');
common.expectsError(
() => search('target', undefined),
{
code: 'ERR_MISSING_MODULE',
type: errors.Error,
message: 'Cannot find module target'
}
);