Skip to content

Commit affcbad

Browse files
committed
test(ngMock): fix the tests to not use global msie
My bad when merging 7e91645. These tests are run with compiled Angular and then the msie is not defined.
1 parent 7e91645 commit affcbad

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

test/ngMock/angular-mocksSpec.js

+17-9
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)