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');
|
const my_path = require('../fixtures/path');
|
||||||
assert.ok(my_path.path_func instanceof Function);
|
assert.ok(my_path.path_func instanceof Function);
|
||||||
// this one does not exist and should throw
|
// 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;
|
let errorThrown = false;
|
||||||
try {
|
try {
|
||||||
@ -126,7 +127,7 @@ assert.strictEqual(require('../fixtures/registerExt.hello.world').test,
|
|||||||
'passed');
|
'passed');
|
||||||
|
|
||||||
console.error('load custom file types that return non-strings');
|
console.error('load custom file types that return non-strings');
|
||||||
require.extensions['.test'] = function(module, filename) {
|
require.extensions['.test'] = function(module) {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
custom: 'passed'
|
custom: 'passed'
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user