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 @@ -16,17 +16,25 @@ describe('setInterval', function() {
1616 const testZone = Zone . current . fork ( Zone [ 'wtfZoneSpec' ] ) . fork ( { name : 'TestZone' } ) ;
1717 testZone . run ( ( ) => {
1818 let id ;
19+ let intervalCount = 0 ;
1920 const intervalFn = function ( ) {
21+ intervalCount ++ ;
2022 expect ( Zone . current . name ) . toEqual ( ( 'TestZone' ) ) ;
2123 global [ zoneSymbol ( 'setTimeout' ) ] ( function ( ) {
24+ const intervalUnitLog = [
25+ '> Zone:invokeTask:setInterval("<root>::ProxyZone::WTF::TestZone")' ,
26+ '< Zone:invokeTask:setInterval'
27+ ] ;
28+ let intervalLog = [ ] ;
29+ for ( let i = 0 ; i < intervalCount ; i ++ ) {
30+ intervalLog = intervalLog . concat ( intervalUnitLog ) ;
31+ }
2232 expect ( wtfMock . log ) . toEqual ( [
2333 '# Zone:fork("<root>::ProxyZone::WTF", "TestZone")' ,
2434 '> Zone:invoke:unit-test("<root>::ProxyZone::WTF::TestZone")' ,
2535 '# Zone:schedule:macroTask:setInterval("<root>::ProxyZone::WTF::TestZone", ' + id + ')' ,
26- '< Zone:invoke:unit-test' ,
27- '> Zone:invokeTask:setInterval("<root>::ProxyZone::WTF::TestZone")' ,
28- '< Zone:invokeTask:setInterval'
29- ] ) ;
36+ '< Zone:invoke:unit-test'
37+ ] . concat ( intervalLog ) ) ;
3038 clearInterval ( cancelId ) ;
3139 done ( ) ;
3240 } ) ;
You can’t perform that action at this time.
0 commit comments