diff --git a/tests/test.util.js b/tests/test.util.js index bce475da..60cdb582 100644 --- a/tests/test.util.js +++ b/tests/test.util.js @@ -63,7 +63,19 @@ describe('Utils', function() { // environments, so we need to redefine it whilst running these // tests. origNavigator = Object.getOwnPropertyDescriptor(window, "navigator"); + if (origNavigator === undefined) { + // Object.getOwnPropertyDescriptor() doesn't work + // properly in any version of IE + this.skip(); + } + Object.defineProperty(window, "navigator", {value: {}}); + if (window.navigator.languages !== undefined) { + // Object.defineProperty() doesn't work properly in old + // versions of Chrome + this.skip(); + } + window.navigator.languages = []; }); afterEach(function () {