PR-URL: https://github.com/nodejs/node/pull/16795 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
18 lines
404 B
JavaScript
18 lines
404 B
JavaScript
'use strict';
|
|
// Flags: --expose-internals
|
|
|
|
// This test ensures that search throws errors appropriately
|
|
|
|
const common = require('../common');
|
|
|
|
const search = require('internal/loader/search');
|
|
const errors = require('internal/errors');
|
|
|
|
common.expectsError(
|
|
() => search('target', undefined),
|
|
{
|
|
code: 'ERR_MISSING_MODULE',
|
|
type: errors.Error,
|
|
message: 'Cannot find module target'
|
|
}
|
|
);
|