test: add regex check to test-module-loading

Also removes extraneous argument.

PR-URL: https://github.com/nodejs/node/pull/11413
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
This commit is contained in:
Tarang Hirani authored and Myles Borins committed 2017-03-08 17:29:23 -08:00
1 parent 9da6ebd73f
commit fa681ea55a
1 file changed
+3 -2
+3 -2
View File
@@ -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 {
@@ -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'
};