File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
packages/zone.js/lib/jasmine Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -239,10 +239,15 @@ export function patchJasmine(Zone: ZoneType): void {
239239 timeout : { setTimeout : Function ; clearTimeout : Function } ;
240240 }
241241 type QueueRunnerUserContext = { queueRunner ?: QueueRunner } ;
242- const QueueRunner = ( jasmine as any ) . QueueRunner as {
242+ const j$ = jasmine as any ;
243+ const privateApis : {
244+ QueueRunner : { } ;
245+ UserContext : new ( ...args : any [ ] ) => QueueRunnerUserContext ;
246+ } = j$ ?. private ?. QueueRunner ? j$ ?. private : j$ ;
247+ const QueueRunner = privateApis . QueueRunner as {
243248 new ( attrs : QueueRunnerAttrs ) : QueueRunner ;
244249 } ;
245- ( jasmine as any ) . QueueRunner = ( function ( _super ) {
250+ privateApis . QueueRunner = ( function ( _super ) {
246251 __extends ( ZoneQueueRunner , _super ) ;
247252 function ZoneQueueRunner ( this : QueueRunner , attrs : QueueRunnerAttrs ) {
248253 if ( attrs . onComplete ) {
@@ -266,9 +271,9 @@ export function patchJasmine(Zone: ZoneType): void {
266271
267272 // create a userContext to hold the queueRunner itself
268273 // so we can access the testProxy in it/xit/beforeEach ...
269- if ( ( jasmine as any ) . UserContext ) {
274+ if ( privateApis . UserContext ) {
270275 if ( ! attrs . userContext ) {
271- attrs . userContext = new ( jasmine as any ) . UserContext ( ) ;
276+ attrs . userContext = new privateApis . UserContext ( ) ;
272277 }
273278 attrs . userContext . queueRunner = this ;
274279 } else {
You can’t perform that action at this time.
0 commit comments