6 lines
34 KiB
JavaScript
6 lines
34 KiB
JavaScript
|
|
"use strict";
|
||
|
|
/**
|
||
|
|
* @license Angular v<unknown>
|
||
|
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
||
|
|
* License: MIT
|
||
|
|
*/function patchJasmine(e){e.__load_patch("jasmine",((e,t,n)=>{if(!t)throw new Error("Missing: zone.js");if("undefined"!=typeof jest)return;if("undefined"==typeof jasmine||jasmine.__zone_patch__)return;jasmine.__zone_patch__=!0;const s=t.SyncTestZoneSpec,r=t.ProxyZoneSpec;if(!s)throw new Error("Missing: SyncTestZoneSpec");if(!r)throw new Error("Missing: ProxyZoneSpec");const i=t.current,o=t.__symbol__,c=!0===e[o("fakeAsyncDisablePatchingClock")],a=!c&&(!0===e[o("fakeAsyncPatchLock")]||!0===e[o("fakeAsyncAutoFakeAsyncWhenClockPatched")]);if(!0!==e[o("ignoreUnhandledRejection")]){const t=jasmine.GlobalErrors;t&&!jasmine[o("GlobalErrors")]&&(jasmine[o("GlobalErrors")]=t,jasmine.GlobalErrors=function(){const n=new t,s=n.install;return s&&!n[o("install")]&&(n[o("install")]=s,n.install=function(){const t="undefined"!=typeof process&&!!process.on,n=t?process.listeners("unhandledRejection"):e.eventListeners("unhandledrejection"),r=s.apply(this,arguments);return t?process.removeAllListeners("unhandledRejection"):e.removeAllListeners("unhandledrejection"),n&&n.forEach((n=>{t?process.on("unhandledRejection",n):e.addEventListener("unhandledrejection",n)})),r}),n})}const l=jasmine.getEnv();if(["describe","xdescribe","fdescribe"].forEach((e=>{let t=l[e];l[e]=function(e,n){return t.call(this,e,function r(e,t){return function(){return i.fork(new s(`jasmine.describe#${e}`)).run(t,this,arguments)}}(e,n))}})),["it","xit","fit"].forEach((e=>{let t=l[e];l[o(e)]=t,l[e]=function(e,n,s){return arguments[1]=h(n),t.apply(this,arguments)}})),["beforeEach","afterEach","beforeAll","afterAll"].forEach((e=>{let t=l[e];l[o(e)]=t,l[e]=function(e,n){return arguments[0]=h(e),t.apply(this,arguments)}})),!c){const e=jasmine[o("clock")]=jasmine.clock;jasmine.clock=function(){const n=e.apply(this,arguments);if(!n[o("patched")]){n[o("patched")]=o("patched");const e=n[o("tick")]=n.tick;n.tick=function(){const n=t.current.get("FakeAsyncTestZoneSpec");return n?n.tick.apply(n,arguments):e.apply(this,arguments)};const s=n[o("mockDate")]=n.mockDate;n.mockDate=function(){const e=t.current.get("FakeAsyncTestZoneSpec");if(e){const t=arguments.length>0?arguments[0]:new Date;return e.setFakeBaseSystemTime.apply(e,t&&"function"==typeof t.getTime?[t.getTime()]:arguments)}return s.apply(this,arguments)},a&&["install","uninstall"].forEach((e=>{const s=n[o(e)]=n[e];n[e]=function(){if(!t.FakeAsyncTestZoneSpec)return s.apply(this,arguments);jasmine[o("clockInstalled")]="install"===e}}))}return n}}if(!jasmine[t.__symbol__("createSpyObj")]){const e=jasmine.createSpyObj;jasmine[t.__symbol__("createSpyObj")]=e,jasmine.createSpyObj=function(){const t=Array.prototype.slice.call(arguments);let n;if(t.length>=3&&t[2]){const s=Object.defineProperty;Object.defineProperty=function(e,t,n){return s.call(this,e,t,{...n,configurable:!0,enumerable:!0})};try{n=e.apply(this,t)}finally{Object.defineProperty=s}}else n=e.apply(this,t);return n}}function u(e,n,s,r){const i=!!jasmine[o("clockInstalled")],c=s.testProxyZone;if(i&&a){const n=t[t.__symbol__("fakeAsyncTest")];n&&"function"==typeof n.fakeAsync&&(e=n.fakeAsync(e))}return r?c.run(e,n,[r]):c.run(e,n)}function h(e){return e&&(e.length?function(t){return u(e,this,this.queueRunner,t)}:function(){return u(e,this,this.queueRunner)})}const p=jasmine.QueueRunner;jasmine.QueueRunner=function(n){function s(s){s.onComplete&&(s.onComplete=(e=>()=>{this.testProxyZone=null,this.testProxyZoneSpec=null,i.scheduleMicroTask("jasmine.onComplete",e)})(s.onComplete));const r=e[t.__symbol__("setTimeout")],o=e[t.__symbol__("clearTimeout")];r&&(s.timeout={setTimeout:r||e.setTimeout,clearTimeout:o||e.clearTimeout}),jasmine.UserContext?(s.userContext||(s.userContext=new jasmine.UserContext),s.userContext.queueRunner=this):(s.userContext||(s.userContext={}),s.userContext.queueRunner=this);const c=s.onException;s.onException=function(e){if(e&&"Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL."===e.message){const t=this&&this.testProxyZoneSpec;if(t){const n=t.getAndClearPendingTasksInfo();try{e.message+=n}catch(e){}
|