Skip to content

Commit

Permalink
Merge pull request #1506 from mroderick/remove-deprecated-exports
Browse files Browse the repository at this point in the history
Remove deprecated core exports
  • Loading branch information
mroderick authored Aug 3, 2017
2 parents 3938c12 + e37e1a6 commit 9ee21ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 47 deletions.
29 changes: 3 additions & 26 deletions lib/sinon.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,8 @@
"use strict";

var match = require("./sinon/match");
var deepEqual = require("./sinon/util/core/deep-equal");
var deprecated = require("./sinon/util/core/deprecated");

function exposeCoreUtils(target, utils) {
var keys = Object.keys(utils);

keys.forEach(function (key) {
var value = utils[key];

// allow deepEqual to check equality of matchers through dependency injection. Otherwise we get a circular
// dependency
if (key === "deepEqual") {
value = deepEqual.use(match);
}
if (typeof value === "function") {
value = deprecated.wrap(value, deprecated.defaultMsg(key));
}
target[key] = value;
});
}

// Expose internal utilities on `sinon` global for backwards compatibility.
exposeCoreUtils(exports, require("./sinon/util/core/index"));

exports.assert = require("./sinon/assert");
exports.collection = require("./sinon/collection");
exports.match = match;
exports.match = require("./sinon/match");
exports.spy = require("./sinon/spy");
exports.spyCall = require("./sinon/call");
exports.stub = require("./sinon/stub");
Expand All @@ -36,6 +11,8 @@ exports.sandbox = require("./sinon/sandbox");
exports.expectation = require("./sinon/mock-expectation");
exports.createStubInstance = require("./sinon/stub").createStubInstance;

exports.defaultConfig = require("./sinon/util/core/default-config");

var fakeTimers = require("./sinon/util/fake_timers");
exports.useFakeTimers = fakeTimers.useFakeTimers;
exports.clock = fakeTimers.clock;
Expand Down
21 changes: 0 additions & 21 deletions lib/sinon/util/core/index.js

This file was deleted.

0 comments on commit 9ee21ad

Please sign in to comment.