test(ngMock): fix the tests to not use global msie

My bad when merging 7e916455b3.

These tests are run with compiled Angular and then the msie is not defined.
This commit is contained in:
Vojta Jina 2014-01-06 19:08:05 -08:00
parent 7e916455b3
commit affcbad501

View file

@ -863,22 +863,30 @@ describe('ngMock', function() {
});
});
// We don't run the following tests on IE8.
// IE8 throws "Object does not support this property or method." error,
// when thrown from a function defined on window (which `inject` is).
if (msie <= 8) return;
it('should not change thrown Errors', function() {
expect(function(){
throw new Error('test message');
}).toThrow('test message');
});
it('should not change thrown Errors', inject(function($sniffer) {
if ($sniffer.msie <= 8) return;
it('should not change thrown strings', function(){
expect(function(){
throw 'test message';
expect(function() {
inject(function() {
throw new Error('test message');
});
}).toThrow('test message');
});
}));
it('should not change thrown strings', inject(function($sniffer) {
if ($sniffer.msie <= 8) return;
expect(function() {
inject(function() {
throw 'test message';
});
}).toThrow('test message');
}));
});
});