Skip to content

Commit

Permalink
Avoid running test for sinonjs#1456 on Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
fatso83 committed Jul 13, 2017
1 parent 717ebf7 commit 3642905
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions test/issues/issues-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
});

Expand All @@ -300,5 +314,4 @@ describe("issues", function () {
assert.equals(window.innerHeight, 111);
});
});
}
});

0 comments on commit 3642905

Please sign in to comment.