diff --git a/test/parallel/test-module-loading-error.js b/test/parallel/test-module-loading-error.js index 80918d5fdb0eb3..ac709df19f58cf 100644 --- a/test/parallel/test-module-loading-error.js +++ b/test/parallel/test-module-loading-error.js @@ -2,17 +2,15 @@ const common = require('../common'); const assert = require('assert'); -console.error('load test-module-loading-error.js'); - -const error_desc = { - win32: ['%1 is not a valid Win32 application'], +const errorMessagesByPlatform = { + win32: ['is not a valid Win32 application'], linux: ['file too short', 'Exec format error'], sunos: ['unknown file type', 'not an ELF file'], darwin: ['file too short'], aix: ['Cannot load module', 'Cannot run a file that does not have a valid format.'] }; -const dlerror_msg = error_desc[process.platform]; +const dlerror_msg = errorMessagesByPlatform[process.platform]; if (!dlerror_msg) common.skip('platform not supported.');