Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Skip Promise tests on unsupported engines
  • Loading branch information
fatso83 committed Aug 1, 2017
1 parent 6c1aa55 commit a712acb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/call-test.js
Expand Up @@ -853,6 +853,8 @@ describe("sinonSpy.call", function () {

// https://github.com/sinonjs/sinon/issues/1066
it("does not throw when the call stack is empty", function (done) {
if (!global.Promise) { this.skip(); }

var stub1 = sinonStub().resolves(1);
var stub2 = sinonStub().returns(1);

Expand Down
5 changes: 5 additions & 0 deletions test/issues/issues-test.js
Expand Up @@ -223,6 +223,7 @@ describe("issues", function () {
});

describe("#1474 - promise library should be propagated through fakes and behaviors", function () {

var stub;

function makeAssertions(fake, expected) {
Expand All @@ -232,6 +233,10 @@ describe("issues", function () {
assert.equals(fake.tap(), expected);
}

before(function () {
if (!global.Promise) { this.skip(); }
});

beforeEach(function () {
var promiseLib = {
resolve: function (value) {
Expand Down
3 changes: 3 additions & 0 deletions test/sandbox-test.js
Expand Up @@ -17,6 +17,7 @@ var sinonAssert = require("../lib/sinon/assert");
var sinonClock = require("../lib/sinon/util/fake_timers");

var supportsAjax = typeof XMLHttpRequest !== "undefined" || typeof ActiveXObject !== "undefined";
var supportPromise = !!global.Promise;
var globalXHR = global.XMLHttpRequest;
var globalAXO = global.ActiveXObject;

Expand Down Expand Up @@ -148,6 +149,7 @@ describe("sinonSandbox", function () {
});

it("must set all stubs created from sandbox with mockPromise", function () {
if (!supportPromise) { return this.skip(); }

var resolveValue = {};
var mockPromise = {
Expand All @@ -167,6 +169,7 @@ describe("sinonSandbox", function () {

// eslint-disable-next-line mocha/no-identical-title
it("must set all stubs created from sandbox with mockPromise", function () {
if (!supportPromise) { return this.skip(); }

var resolveValue = {};
var mockPromise = {
Expand Down
1 change: 1 addition & 0 deletions test/sinon-test.js
@@ -1,5 +1,6 @@
"use strict";

var proxyquire = require("proxyquire");
var assert = require("referee").assert;
var hasPromise = typeof Promise === "function";

Expand Down

0 comments on commit a712acb

Please sign in to comment.