Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1504 from fatso83/fix-build-and-test-bugs
Fix build and test bugs in #1498 and #1479
  • Loading branch information
fatso83 committed Aug 1, 2017
2 parents 6c1aa55 + 521a0f7 commit 309dcef
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
16 changes: 11 additions & 5 deletions package.json
Expand Up @@ -15,15 +15,18 @@
"license": "BSD-3-Clause",
"scripts": {
"test-node": "mocha --recursive -R dot test/",
"test-dev": "npm run test-node -- --watch -R min",
"test-headless": "mochify --recursive -R dot --grep WebWorker --invert test/",
"test-dev": "run-s test-node -- --watch -R min",
"test-headless": "mochify --recursive -R dot --grep WebWorker --invert --plugin [ proxyquire-universal ] test/",
"test-coverage": "mochify --recursive -R dot --grep WebWorker --invert --plugin [ mochify-istanbul --exclude '**/+(test|node_modules)/**/*' --report text --report lcovonly --dir ./coverage ] test/",
"test-cloud": "npm run test-headless -- --wd",
"test-cloud": "run-s test-headless -- --wd",
"test-webworker": "browserify --no-commondir --full-paths -p [ mocaccino -R spec --color ] test/webworker/webworker-support-assessment.js | phantomic --web-security false",
"test": "npm run test-node && npm run test-headless && npm run test-webworker",
"test": "run-s test-node test-headless test-webworker",
"build": "./build.js",
"lint": "eslint .",
"precommit": "lint-staged",
"prepublish": "rimraf pkg && ./build.js",
"pretest-webworker": "run-s build",
"prebuild": "rimraf pkg",
"prepublishOnly": "run -s build",
"preversion": "./scripts/preversion.sh",
"postversion": "./scripts/postversion.sh",
"eslint-pre-commit": "./scripts/eslint-pre-commit"
Expand Down Expand Up @@ -53,9 +56,12 @@
"mocha": "^3.1.2",
"mochify": "^3.0.0",
"mochify-istanbul": "^2.4.1",
"npm-run-all": "^4.0.2",
"phantomic": "^1.4.0",
"phantomjs-prebuilt": "^2.1.14",
"proxyquire": "^1.8.0",
"proxyquire-universal": "^1.0.8",
"proxyquireify": "^3.2.1",
"referee": "^1.2.0",
"rimraf": "^2.5.3"
},
Expand Down
4 changes: 4 additions & 0 deletions test/call-test.js
Expand Up @@ -852,7 +852,10 @@ describe("sinonSpy.call", function () {
});

// https://github.com/sinonjs/sinon/issues/1066
/* eslint-disable consistent-return */
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 All @@ -867,6 +870,7 @@ describe("sinonSpy.call", function () {
})
.catch( done );
});
/* eslint-enable consistent-return */
});

describe("constructor", function () {
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
2 changes: 1 addition & 1 deletion 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 All @@ -12,7 +13,6 @@ describe("sinon module", function () {
fakeNise;

beforeEach(function () {
var proxyquire = require("proxyquire");

fakeNise = {
fakeServer: "47c86a4c-6b48-4748-bb8c-d853f999720c",
Expand Down

0 comments on commit 309dcef

Please sign in to comment.