diff --git a/test/issues/issues-test.js b/test/issues/issues-test.js index 73a5c953f..a7c9e300a 100644 --- a/test/issues/issues-test.js +++ b/test/issues/issues-test.js @@ -7,7 +7,6 @@ var configureLogError = require("../../lib/sinon/util/core/log_error.js"); var assert = referee.assert; var refute = referee.refute; - describe("issues", function () { beforeEach(function () { this.sandbox = sinon.sandbox.create(); @@ -282,11 +281,26 @@ describe("issues", function () { }); }); - if (typeof window !== "undefined") { + describe("#1456", function () { var sandbox; beforeEach(function () { + if(typeof window === "undefined") { this.skip(); } + + var throwsOnUnconfigurableProperty = false; + var preDescriptor = Object.getOwnPropertyDescriptor(window, "innerHeight"); + /* eslint-disable no-restricted-syntax */ + try { + Object.defineProperty(window, "innerHeight", { value: 10, configureable: true, writeable: true }); + Object.defineProperty(window, "innerHeight", preDescriptor); + } catch (err) { + throwsOnUnconfigurableProperty = true; + } + /* eslint-enable no-restricted-syntax */ + + if(throwsOnUnconfigurableProperty) { this.skip(); } + sandbox = sinonSandbox.create(); }); @@ -300,5 +314,4 @@ describe("issues", function () { assert.equals(window.innerHeight, 111); }); }); - } });