Improve isIE check to allow us to check for a minimum version
This commit is contained in:
@@ -40,8 +40,8 @@ describe("ExceptionFormatter", function() {
|
||||
});
|
||||
|
||||
describe("#stack", function() {
|
||||
it("formats stack traces from Webkit, Firefox or node.js", function() {
|
||||
if (isIE()) { return; }
|
||||
it("formats stack traces from Webkit, Firefox, node.js or IE10+", function() {
|
||||
if (jasmine.getGlobal().ieVersion < 10) { return; }
|
||||
|
||||
var error;
|
||||
try { throw new Error("an error") } catch(e) { error = e; }
|
||||
|
||||
@@ -111,7 +111,7 @@ describe("matchersUtil", function() {
|
||||
});
|
||||
|
||||
it("passes for equivalent frozen objects (GitHub issue #266)", function() {
|
||||
if (isIE(8)) { return; }
|
||||
if (jasmine.getGlobal().ieVersion < 9) { return; }
|
||||
|
||||
var a = { foo: 1 },
|
||||
b = {foo: 1 };
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
function isIE(version) {
|
||||
var userAgent = jasmine.getGlobal().navigator.userAgent;
|
||||
if (!userAgent) { return; }
|
||||
(function(global) {
|
||||
global.ieVersion = (function() {
|
||||
var userAgent = jasmine.getGlobal().navigator.userAgent;
|
||||
if (!userAgent) { return Number.MAX_VALUE; }
|
||||
|
||||
var match = /MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(userAgent);
|
||||
var match = /MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(userAgent);
|
||||
|
||||
return match && version ? parseFloat(match[1]) === version : match;
|
||||
}
|
||||
return match ? parseFloat(match[1]) : Number.MAX_VALUE;
|
||||
})();
|
||||
})(jasmine.getGlobal());
|
||||
Reference in New Issue
Block a user