Skip language tests on broken browsers
The hacks needed to run these tests require proper handling of properties. Unfortunately IE and old versions of Chrome mess up, so just skip the tests there.
This commit is contained in:
parent
acca6487f2
commit
6ec3af22ca
|
@ -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 () {
|
||||
|
|
Loading…
Reference in New Issue