This repository was archived by the owner on Feb 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44if ( ! Zone ) {
55 throw new Error ( 'zone.js does not seem to be installed' ) ;
66}
7-
8- const SET_TIMEOUT = '__zone_symbol__setTimeout' ;
9- const _global = typeof window == 'undefined' ? global : window ;
10-
11-
127// When you have in async test (test with `done` argument) jasmine will
138// execute the next test synchronously in the done handler. This makes sense
149// for most tests, but now with zones. With zones running next test
@@ -17,10 +12,14 @@ const _global = typeof window == 'undefined' ? global : window;
1712// it. We override the `clearStack` method which forces jasmine to always
1813// drain the stack before next test gets executed.
1914( < any > jasmine ) . QueueRunner = ( function ( SuperQueueRunner ) {
15+ const originalZone = Zone . current ;
2016 // Subclass the `QueueRunner` and override the `clearStack` method.
2117
2218 function alwaysClearStack ( fn ) {
23- _global [ SET_TIMEOUT ] ( fn , 0 ) ;
19+ const zone : Zone = Zone . current . getZoneWith ( 'JasmineClearStackZone' )
20+ || Zone . current . getZoneWith ( 'ProxyZoneSpec' )
21+ || originalZone ;
22+ zone . scheduleMicroTask ( 'jasmineCleanStack' , fn ) ;
2423 }
2524
2625 function QueueRunner ( options ) {
You can’t perform that action at this time.
0 commit comments