@@ -184,6 +184,7 @@ main() => describe('scope', () {
184
184
}));
185
185
});
186
186
187
+
187
188
describe ('properties' , () {
188
189
describe ('root' , () {
189
190
it ('should point to itself' , inject ((RootScope rootScope) {
@@ -213,6 +214,7 @@ main() => describe('scope', () {
213
214
});
214
215
});
215
216
217
+
216
218
describe (r'events' , () {
217
219
218
220
describe ('on' , () {
@@ -482,7 +484,8 @@ main() => describe('scope', () {
482
484
});
483
485
});
484
486
485
- describe (r'$destroy' , () {
487
+
488
+ describe (r'destroy' , () {
486
489
var first = null , middle = null , last = null , log = null ;
487
490
488
491
beforeEach (inject ((RootScope rootScope) {
@@ -531,7 +534,7 @@ main() => describe('scope', () {
531
534
}));
532
535
533
536
534
- it (r'should broadcast the $ destroy event' , inject ((RootScope rootScope) {
537
+ it (r'should broadcast the destroy event' , inject ((RootScope rootScope) {
535
538
var log = [];
536
539
first.on (ScopeEvent .DESTROY ).listen ((s) => log.add ('first' ));
537
540
first.createChild ({}).on (ScopeEvent .DESTROY ).listen ((s) => log.add ('first-child' ));
@@ -540,7 +543,8 @@ main() => describe('scope', () {
540
543
expect (log).toEqual (['first' , 'first-child' ]);
541
544
}));
542
545
});
543
-
546
+
547
+
544
548
describe ('digest lifecycle' , () {
545
549
it (r'should apply expression with full lifecycle' , inject ((RootScope rootScope) {
546
550
var log = '' ;
@@ -554,16 +558,16 @@ main() => describe('scope', () {
554
558
it (r'should catch exceptions' , () {
555
559
module ((Module module) => module.type (ExceptionHandler , implementedBy: LoggingExceptionHandler ));
556
560
inject ((RootScope rootScope, ExceptionHandler e) {
557
- LoggingExceptionHandler $ exceptionHandler = e;
561
+ LoggingExceptionHandler exceptionHandler = e;
558
562
var log = [];
559
563
var child = rootScope.createChild ({});
560
564
rootScope.watch ('a' , (a, _) => log.add ('1' ));
561
565
rootScope.context['a' ] = 0 ;
562
566
child.apply (() { throw 'MyError' ; });
563
567
expect (log.join (',' )).toEqual ('1' );
564
- expect ($ exceptionHandler.errors[0 ].error).toEqual ('MyError' );
565
- $ exceptionHandler.errors.removeAt (0 );
566
- $ exceptionHandler.assertEmpty ();
568
+ expect (exceptionHandler.errors[0 ].error).toEqual ('MyError' );
569
+ exceptionHandler.errors.removeAt (0 );
570
+ exceptionHandler.assertEmpty ();
567
571
});
568
572
});
569
573
@@ -584,11 +588,11 @@ main() => describe('scope', () {
584
588
585
589
it (r'should execute and return value and update' , inject (
586
590
(RootScope rootScope, ExceptionHandler e) {
587
- LoggingExceptionHandler $ exceptionHandler = e;
591
+ LoggingExceptionHandler exceptionHandler = e;
588
592
rootScope.context['name' ] = 'abc' ;
589
593
expect (rootScope.apply ((context) => context['name' ])).toEqual ('abc' );
590
594
expect (log).toEqual ('digest;digest;' );
591
- $ exceptionHandler.assertEmpty ();
595
+ exceptionHandler.assertEmpty ();
592
596
}));
593
597
594
598
@@ -599,11 +603,11 @@ main() => describe('scope', () {
599
603
600
604
601
605
it (r'should catch exception and update' , inject ((RootScope rootScope, ExceptionHandler e) {
602
- LoggingExceptionHandler $ exceptionHandler = e;
606
+ LoggingExceptionHandler exceptionHandler = e;
603
607
var error = 'MyError' ;
604
608
rootScope.apply (() { throw error; });
605
609
expect (log).toEqual ('digest;digest;' );
606
- expect ($ exceptionHandler.errors[0 ].error).toEqual (error);
610
+ expect (exceptionHandler.errors[0 ].error).toEqual (error);
607
611
}));
608
612
});
609
613
@@ -613,8 +617,8 @@ main() => describe('scope', () {
613
617
expect (() => rootScope.apply (() { throw error; })).toThrow (error);
614
618
}));
615
619
});
616
-
617
-
620
+
621
+
618
622
describe ('flush lifecycle' , () {
619
623
it (r'should apply expression with full lifecycle' , inject ((RootScope rootScope) {
620
624
var log = '' ;
@@ -637,16 +641,16 @@ main() => describe('scope', () {
637
641
it (r'should catch exceptions' , () {
638
642
module ((Module module) => module.type (ExceptionHandler , implementedBy: LoggingExceptionHandler ));
639
643
inject ((RootScope rootScope, ExceptionHandler e) {
640
- LoggingExceptionHandler $ exceptionHandler = e;
644
+ LoggingExceptionHandler exceptionHandler = e;
641
645
var log = [];
642
646
var child = rootScope.createChild ({});
643
647
rootScope.observe ('a' , (a, _) => log.add ('1' ));
644
648
rootScope.context['a' ] = 0 ;
645
649
child.apply (() { throw 'MyError' ; });
646
650
expect (log.join (',' )).toEqual ('1' );
647
- expect ($ exceptionHandler.errors[0 ].error).toEqual ('MyError' );
648
- $ exceptionHandler.errors.removeAt (0 );
649
- $ exceptionHandler.assertEmpty ();
651
+ expect (exceptionHandler.errors[0 ].error).toEqual ('MyError' );
652
+ exceptionHandler.errors.removeAt (0 );
653
+ exceptionHandler.assertEmpty ();
650
654
});
651
655
});
652
656
@@ -667,11 +671,11 @@ main() => describe('scope', () {
667
671
668
672
it (r'should execute and return value and update' , inject (
669
673
(RootScope rootScope, ExceptionHandler e) {
670
- LoggingExceptionHandler $ exceptionHandler = e;
674
+ LoggingExceptionHandler exceptionHandler = e;
671
675
rootScope.context['name' ] = 'abc' ;
672
676
expect (rootScope.apply ((context) => context['name' ])).toEqual ('abc' );
673
677
expect (log).toEqual ('digest;digest;' );
674
- $ exceptionHandler.assertEmpty ();
678
+ exceptionHandler.assertEmpty ();
675
679
}));
676
680
677
681
it (r'should execute and return value and update' , inject ((RootScope rootScope) {
@@ -680,11 +684,11 @@ main() => describe('scope', () {
680
684
}));
681
685
682
686
it (r'should catch exception and update' , inject ((RootScope rootScope, ExceptionHandler e) {
683
- LoggingExceptionHandler $ exceptionHandler = e;
687
+ LoggingExceptionHandler exceptionHandler = e;
684
688
var error = 'MyError' ;
685
689
rootScope.apply (() { throw error; });
686
690
expect (log).toEqual ('digest;digest;' );
687
- expect ($ exceptionHandler.errors[0 ].error).toEqual (error);
691
+ expect (exceptionHandler.errors[0 ].error).toEqual (error);
688
692
}));
689
693
690
694
it (r'should throw assertion when model changes in flush' , inject ((RootScope rootScope, Logger log) {
@@ -793,12 +797,12 @@ main() => describe('scope', () {
793
797
module.type (ExceptionHandler , implementedBy: LoggingExceptionHandler );
794
798
});
795
799
inject ((RootScope rootScope, ExceptionHandler e) {
796
- LoggingExceptionHandler $ exceptionHandler = e;
800
+ LoggingExceptionHandler exceptionHandler = e;
797
801
rootScope.watch ('a' , (n, o) {throw 'abc' ;});
798
802
rootScope.context['a' ] = 1 ;
799
803
rootScope.digest ();
800
- expect ($ exceptionHandler.errors.length).toEqual (1 );
801
- expect ($ exceptionHandler.errors[0 ].error).toEqual ('abc' );
804
+ expect (exceptionHandler.errors.length).toEqual (1 );
805
+ expect (exceptionHandler.errors[0 ].error).toEqual ('abc' );
802
806
});
803
807
});
804
808
@@ -990,7 +994,7 @@ main() => describe('scope', () {
990
994
expect (log).toEqual ('parent.async;parent.digest;' );
991
995
}));
992
996
993
- it (r'should cause a $ digest rerun' , inject ((RootScope rootScope) {
997
+ it (r'should cause a digest rerun' , inject ((RootScope rootScope) {
994
998
rootScope.context['log' ] = '' ;
995
999
rootScope.context['value' ] = 0 ;
996
1000
// NOTE(deboer): watch listener string functions not yet supported
0 commit comments