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 <cjihrig@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
  • Loading branch information
tarang9211 authored and MylesBorins committed Mar 9, 2017
1 parent eca1e80 commit b2f7e7a
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 @@ -97,7 +97,8 @@ console.error('test name clashes');
var 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'$/);

var errorThrown = false;
try {
Expand All @@ -124,7 +125,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 b2f7e7a

Please sign in to comment.