File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed
Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -863,22 +863,30 @@ describe('ngMock', function() {
863863 } ) ;
864864 } ) ;
865865
866+
866867 // We don't run the following tests on IE8.
867868 // IE8 throws "Object does not support this property or method." error,
868869 // when thrown from a function defined on window (which `inject` is).
869- if ( msie <= 8 ) return ;
870870
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+ } ) ;
874878 } ) . toThrow ( 'test message' ) ;
875- } ) ;
879+ } ) ) ;
876880
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+ } ) ;
880888 } ) . toThrow ( 'test message' ) ;
881- } ) ;
889+ } ) ) ;
882890 } ) ;
883891 } ) ;
884892
You can’t perform that action at this time.
0 commit comments