This repository was archived by the owner on Feb 26, 2024. It is now read-only.
File tree 1 file changed +12
-4
lines changed
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -16,17 +16,25 @@ describe('setInterval', function() {
16
16
const testZone = Zone . current . fork ( Zone [ 'wtfZoneSpec' ] ) . fork ( { name : 'TestZone' } ) ;
17
17
testZone . run ( ( ) => {
18
18
let id ;
19
+ let intervalCount = 0 ;
19
20
const intervalFn = function ( ) {
21
+ intervalCount ++ ;
20
22
expect ( Zone . current . name ) . toEqual ( ( 'TestZone' ) ) ;
21
23
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
+ }
22
32
expect ( wtfMock . log ) . toEqual ( [
23
33
'# Zone:fork("<root>::ProxyZone::WTF", "TestZone")' ,
24
34
'> Zone:invoke:unit-test("<root>::ProxyZone::WTF::TestZone")' ,
25
35
'# 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 ) ) ;
30
38
clearInterval ( cancelId ) ;
31
39
done ( ) ;
32
40
} ) ;
You can’t perform that action at this time.
0 commit comments