This repository was archived by the owner on Feb 26, 2024. It is now read-only.
File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 4
4
if ( ! Zone ) {
5
5
throw new Error ( 'zone.js does not seem to be installed' ) ;
6
6
}
7
-
8
- const SET_TIMEOUT = '__zone_symbol__setTimeout' ;
9
- const _global = typeof window == 'undefined' ? global : window ;
10
-
11
-
12
7
// When you have in async test (test with `done` argument) jasmine will
13
8
// execute the next test synchronously in the done handler. This makes sense
14
9
// for most tests, but now with zones. With zones running next test
@@ -17,10 +12,14 @@ const _global = typeof window == 'undefined' ? global : window;
17
12
// it. We override the `clearStack` method which forces jasmine to always
18
13
// drain the stack before next test gets executed.
19
14
( < any > jasmine ) . QueueRunner = ( function ( SuperQueueRunner ) {
15
+ const originalZone = Zone . current ;
20
16
// Subclass the `QueueRunner` and override the `clearStack` method.
21
17
22
18
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 ) ;
24
23
}
25
24
26
25
function QueueRunner ( options ) {
You can’t perform that action at this time.
0 commit comments