From 7ab21b2f5702ae0b2a5fe5d30ec356f83a95f698 Mon Sep 17 00:00:00 2001 From: qualitymanifest Date: Fri, 29 Nov 2019 23:11:21 -0500 Subject: lib: add parent to ERR_UNKNOWN_FILE_EXTENSION - default_resolve updated to pass parentURL into error - ERR_UNKNOWN_FILE_EXTENSION updated to include parentURL - test added to check for import message in error PR-URL: https://github.com/nodejs/node/pull/30728 Fixes: https://github.com/nodejs/node/issues/30721 Reviewed-By: Guy Bedford Reviewed-By: Trivikram Kamat Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca --- test/es-module/test-esm-invalid-extension.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/es-module/test-esm-invalid-extension.js b/test/es-module/test-esm-invalid-extension.js index cdf9476b29..87b0c6691d 100644 --- a/test/es-module/test-esm-invalid-extension.js +++ b/test/es-module/test-esm-invalid-extension.js @@ -6,8 +6,10 @@ const { spawnSync } = require('child_process'); const fixture = fixtures.path('/es-modules/import-invalid-ext.mjs'); const child = spawnSync(process.execPath, [fixture]); const errMsg = 'TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension'; +const importMsg = `imported from ${fixture}`; assert.strictEqual(child.status, 1); assert.strictEqual(child.signal, null); assert.strictEqual(child.stdout.toString().trim(), ''); assert(child.stderr.toString().includes(errMsg)); +assert(child.stderr.toString().includes(importMsg)); -- cgit v1.2.3