diff --git a/packages/upgrade/test/common/test_helpers.ts b/packages/upgrade/test/common/test_helpers.ts index de38d1d6ba..9c7f64b919 100644 --- a/packages/upgrade/test/common/test_helpers.ts +++ b/packages/upgrade/test/common/test_helpers.ts @@ -69,7 +69,18 @@ export function createWithEachNg1VersionFn(setNg1: typeof setAngularJSGlobal) { (prev, file) => prev.then(() => new Promise((resolve, reject) => { const script = document.createElement('script'); script.async = true; - script.onerror = reject; + script.onerror = () => { + // Whenever the script failed loading, browsers will + // just pass an "ErrorEvent" which does not contain + // useful information on most browsers we run tests + // against. In order to avoid writing logic to convert + // the event into a readable error and since just + // passing the event might cause people to spend + // unnecessary time debugging the "ErrorEvent", we + // create a simple error that doesn't imply that there + // is a lot of information within the "ErrorEvent". + reject(`An error occurred while loading: "${file}".`); + }; script.onload = () => { document.body.removeChild(script); resolve();