mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
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:
1 parent
9da6ebd73f
commit
fa681ea55a
1 file changed
+3
-2
@@ -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'
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user