mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
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:
parent
7e916455b3
commit
affcbad501
1 changed files with 18 additions and 10 deletions
28
test/ngMock/angular-mocksSpec.js
vendored
28
test/ngMock/angular-mocksSpec.js
vendored
|
|
@ -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');
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue