From 34220b75e258d85ccd3996ca39ed41c5b035e932 Mon Sep 17 00:00:00 2001 From: Tarang Hirani Date: Thu, 16 Feb 2017 12:44:13 +0530 Subject: [PATCH] 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 Reviewed-By: Gibson Fahnestock Reviewed-By: Yuta Hiroto --- test/sequential/test-module-loading.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/sequential/test-module-loading.js b/test/sequential/test-module-loading.js index dd4e7ba76b611f..3355930df60c6d 100644 --- a/test/sequential/test-module-loading.js +++ b/test/sequential/test-module-loading.js @@ -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' };