@ -14,7 +14,9 @@ Zone.__load_patch('jasmine', (global: any, Zone: ZoneType, api: _ZonePrivate) =>
|
||||
const __extends = function(d: any, b: any) {
|
||||
for (const p in b)
|
||||
if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __(this: Object) { this.constructor = d; }
|
||||
function __(this: Object) {
|
||||
this.constructor = d;
|
||||
}
|
||||
d.prototype = b === null ? Object.create(b) : ((__.prototype = b.prototype), new (__ as any)());
|
||||
};
|
||||
// Patch jasmine's describe/it/beforeEach/afterEach functions so test code always runs
|
||||
@ -126,9 +128,9 @@ Zone.__load_patch('jasmine', (global: any, Zone: ZoneType, api: _ZonePrivate) =>
|
||||
if (fakeAsyncZoneSpec) {
|
||||
const dateTime = arguments.length > 0 ? arguments[0] : new Date();
|
||||
return fakeAsyncZoneSpec.setCurrentRealTime.apply(
|
||||
fakeAsyncZoneSpec, dateTime && typeof dateTime.getTime === 'function' ?
|
||||
[dateTime.getTime()] :
|
||||
arguments);
|
||||
fakeAsyncZoneSpec,
|
||||
dateTime && typeof dateTime.getTime === 'function' ? [dateTime.getTime()] :
|
||||
arguments);
|
||||
}
|
||||
return originalMockDate.apply(this, arguments);
|
||||
};
|
||||
@ -163,8 +165,8 @@ Zone.__load_patch('jasmine', (global: any, Zone: ZoneType, api: _ZonePrivate) =>
|
||||
function runInTestZone(
|
||||
testBody: Function, applyThis: any, queueRunner: QueueRunner, done?: Function) {
|
||||
const isClockInstalled = !!(jasmine as any)[symbol('clockInstalled')];
|
||||
const testProxyZoneSpec = queueRunner.testProxyZoneSpec !;
|
||||
const testProxyZone = queueRunner.testProxyZone !;
|
||||
const testProxyZoneSpec = queueRunner.testProxyZoneSpec!;
|
||||
const testProxyZone = queueRunner.testProxyZone!;
|
||||
let lastDelegate;
|
||||
if (isClockInstalled && enableAutoFakeAsyncWhenClockPatched) {
|
||||
// auto run a fakeAsync
|
||||
@ -190,9 +192,9 @@ Zone.__load_patch('jasmine', (global: any, Zone: ZoneType, api: _ZonePrivate) =>
|
||||
// Note we have to make a function with correct number of arguments, otherwise jasmine will
|
||||
// think that all functions are sync or async.
|
||||
return (testBody && (testBody.length ? function(this: QueueRunnerUserContext, done: Function) {
|
||||
return runInTestZone(testBody, this, this.queueRunner !, done);
|
||||
return runInTestZone(testBody, this, this.queueRunner!, done);
|
||||
} : function(this: QueueRunnerUserContext) {
|
||||
return runInTestZone(testBody, this, this.queueRunner !);
|
||||
return runInTestZone(testBody, this, this.queueRunner!);
|
||||
}));
|
||||
}
|
||||
interface QueueRunner {
|
||||
|
Reference in New Issue
Block a user