diff --git a/test/issues/issues-test.js b/test/issues/issues-test.js index 99461e547..9280f08e1 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(); @@ -252,7 +251,20 @@ describe("issues", function () { }); if (typeof window !== "undefined") { + + 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 */ + describe("#1456", function () { + if (throwsOnUnconfigurableProperty) { return; } var sandbox; beforeEach(function () {