Skip to content

Commit

Permalink
Fix lint violations for no-useless-call
Browse files Browse the repository at this point in the history
  • Loading branch information
mroderick committed Oct 8, 2018
1 parent 91fb220 commit 8e3d798
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/sinon/create-sandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function prepareSandboxFromConfig(config) {

if (config.useFakeTimers) {
if (typeof config.useFakeTimers === "object") {
sandbox.useFakeTimers.call(sandbox, config.useFakeTimers);
sandbox.useFakeTimers(config.useFakeTimers);
} else {
sandbox.useFakeTimers();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/sinon/sandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function Sandbox() {
if (typeof constructor !== "function") {
throw new TypeError("The constructor should be a function.");
}
return this.stub.call(this, Object.create(constructor.prototype));
return this.stub(Object.create(constructor.prototype));
};

sandbox.inject = function inject(obj) {
Expand Down
2 changes: 1 addition & 1 deletion lib/sinon/spy.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ var spyApi = {
formatter = spyApi.formatters[specifyer];

if (typeof formatter === "function") {
return String(formatter.call(null, spyInstance, args));
return String(formatter(spyInstance, args));
} else if (!isNaN(parseInt(specifyer, 10))) {
return sinonFormat(args[specifyer - 1]);
}
Expand Down
4 changes: 2 additions & 2 deletions test/sandbox-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1483,8 +1483,8 @@ describe("Sandbox", function () {
var sandbox = createSandbox();
var fakes = sandbox.getFakes();

fakes.push.call(fakes, {verify: sinonSpy()});
fakes.push.call(fakes, {verify: sinonSpy()});
fakes.push({verify: sinonSpy()});
fakes.push({verify: sinonSpy()});

sandbox.verify();

Expand Down

0 comments on commit 8e3d798

Please sign in to comment.