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 <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>
  • Loading branch information
clakech authored and MylesBorins committed Nov 17, 2017
1 parent af8b17a commit dc14c25
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 dc14c25

Please sign in to comment.