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:
parent
88035bc60d
commit
a4c3e31ac7
@ -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 {
|
||||
@ -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'
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user