Skip to content

Commit

Permalink
loader: test search module
Browse files Browse the repository at this point in the history
PR-URL: #16795
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
clakech authored and jasnell committed Nov 12, 2017
1 parent 3fe165a commit e0113ab
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/es-module/test-esm-loader-search.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'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'
}
);

0 comments on commit e0113ab

Please sign in to comment.