mirror of
https://github.com/nodejs/node.git
synced 2024-11-29 23:16:30 +01:00
921fb84687
PR-URL: https://github.com/nodejs/node/pull/16874 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
19 lines
416 B
JavaScript
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'
|
|
}
|
|
);
|