aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVojta Jina2014-01-06 19:08:05 -0800
committerVojta Jina2014-01-06 19:08:05 -0800
commitaffcbad501ad5e17b8cb30ad8a2c0d1de6686722 (patch)
tree8338800c263b0116157090c5841c021bc27be184
parent7e916455b36dc9ca4d4afc1e44cade90006d00e3 (diff)
downloadangular.js-affcbad501ad5e17b8cb30ad8a2c0d1de6686722.tar.bz2
test(ngMock): fix the tests to not use global msie
My bad when merging 7e916455b36dc9ca4d4afc1e44cade90006d00e3. These tests are run with compiled Angular and then the msie is not defined.
-rw-r--r--test/ngMock/angular-mocksSpec.js26
1 files changed, 17 insertions, 9 deletions
diff --git a/test/ngMock/angular-mocksSpec.js b/test/ngMock/angular-mocksSpec.js
index 6c096471..fb602adc 100644
--- a/test/ngMock/angular-mocksSpec.js
+++ b/test/ngMock/angular-mocksSpec.js
@@ -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');
+ it('should not change thrown Errors', inject(function($sniffer) {
+ if ($sniffer.msie <= 8) return;
+
+ expect(function() {
+ inject(function() {
+ throw new Error('test message');
+ });
}).toThrow('test message');
- });
+ }));
- it('should not change thrown strings', function(){
- expect(function(){
- throw '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');
- });
+ }));
});
});