Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add proxyquire-universal to headless run
This commit reintroduces the proxyquire-universal changes that
caused some issues (see #1498 and commit cbf1128).

What is different is that it removes proxyquire from the build step.
This should never have been there, and was probably introduced to
make proxyquire calls in the tests work with browsers. The problem
was that the tests are not using the built sinon file, so the
config changes would only be utilized for the built file.

By adding the proxquire-universal plugin to the NPM script "test-headless"
it would only take place for these tests and the cloud tests (which are
reusing the headless config).

This commit, along with the previous, fixes #1498.
  • Loading branch information
fatso83 committed Aug 1, 2017
1 parent a63234a commit d37ca03
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -16,7 +16,7 @@
"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-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-webworker": "browserify --no-commondir --full-paths -p [ mocaccino -R spec --color ] test/webworker/webworker-support-assessment.js | phantomic --web-security false",
Expand Down Expand Up @@ -56,6 +56,8 @@
"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
2 changes: 2 additions & 0 deletions test/call-test.js
Expand Up @@ -852,6 +852,7 @@ 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(); }

Expand All @@ -869,6 +870,7 @@ describe("sinonSpy.call", function () {
})
.catch( done );
});
/* eslint-enable consistent-return */
});

describe("constructor", function () {
Expand Down
1 change: 0 additions & 1 deletion test/sinon-test.js
Expand Up @@ -3,7 +3,6 @@
var proxyquire = require("proxyquire");
var assert = require("referee").assert;
var hasPromise = typeof Promise === "function";
var proxyquire = require("proxyquire");

if (!hasPromise) {
return;
Expand Down

0 comments on commit d37ca03

Please sign in to comment.