File tree 1 file changed +17
-9
lines changed
1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -863,22 +863,30 @@ describe('ngMock', function() {
863
863
} ) ;
864
864
} ) ;
865
865
866
+
866
867
// We don't run the following tests on IE8.
867
868
// IE8 throws "Object does not support this property or method." error,
868
869
// when thrown from a function defined on window (which `inject` is).
869
- if ( msie <= 8 ) return ;
870
870
871
- it ( 'should not change thrown Errors' , function ( ) {
872
- expect ( function ( ) {
873
- throw new Error ( 'test message' ) ;
871
+ it ( 'should not change thrown Errors' , inject ( function ( $sniffer ) {
872
+ if ( $sniffer . msie <= 8 ) return ;
873
+
874
+ expect ( function ( ) {
875
+ inject ( function ( ) {
876
+ throw new Error ( 'test message' ) ;
877
+ } ) ;
874
878
} ) . toThrow ( 'test message' ) ;
875
- } ) ;
879
+ } ) ) ;
876
880
877
- it ( 'should not change thrown strings' , function ( ) {
878
- expect ( function ( ) {
879
- throw 'test message' ;
881
+ it ( 'should not change thrown strings' , inject ( function ( $sniffer ) {
882
+ if ( $sniffer . msie <= 8 ) return ;
883
+
884
+ expect ( function ( ) {
885
+ inject ( function ( ) {
886
+ throw 'test message' ;
887
+ } ) ;
880
888
} ) . toThrow ( 'test message' ) ;
881
- } ) ;
889
+ } ) ) ;
882
890
} ) ;
883
891
} ) ;
884
892
You can’t perform that action at this time.
0 commit comments