Skip to content

Commit

Permalink
test: add regex check to test-module-loading
Browse files Browse the repository at this point in the history
Also removes extraneous argument.

PR-URL: #11413
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
  • Loading branch information
tarang9211 authored and addaleax committed Feb 22, 2017
1 parent c5ff76d commit 34220b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/sequential/test-module-loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ console.error('test name clashes');
const my_path = require('../fixtures/path');
assert.ok(my_path.path_func instanceof Function);
// this one does not exist and should throw
assert.throws(function() { require('./utils'); });
assert.throws(function() { require('./utils'); },
/^Error: Cannot find module '.\/utils'$/);

let errorThrown = false;
try {
Expand All @@ -126,7 +127,7 @@ assert.strictEqual(require('../fixtures/registerExt.hello.world').test,
'passed');

console.error('load custom file types that return non-strings');
require.extensions['.test'] = function(module, filename) {
require.extensions['.test'] = function(module) {
module.exports = {
custom: 'passed'
};
Expand Down

0 comments on commit 34220b7

Please sign in to comment.