Modernize sinon.stub() calls

This commit is contained in:
Tom Najdek 2017-05-31 16:44:35 +01:00 committed by Dan Stillman
parent 506b35840e
commit 063e13ef22
5 changed files with 19 additions and 13 deletions

View file

@ -188,7 +188,7 @@ describe("Zotero.DataDirectory", function () {
yield populateDataDirectory(oldDir, null, automatic);
let origFunc = OS.File.move;
let fileMoveStub = sinon.stub(OS.File, "move", function () {
let fileMoveStub = sinon.stub(OS.File, "move").callsFake(function () {
if (OS.Path.basename(arguments[0]) == storageFile1) {
return Zotero.Promise.reject(new Error("Error"));
}
@ -241,7 +241,7 @@ describe("Zotero.DataDirectory", function () {
yield populateDataDirectory(oldDir, null, automatic);
let origFunc = OS.File.move;
let stub1 = sinon.stub(OS.File, "move", function () {
let stub1 = sinon.stub(OS.File, "move").callsFake(function () {
if (OS.Path.basename(arguments[0]) == dbFilename) {
return Zotero.Promise.reject(new Error("Error"));
}
@ -371,7 +371,7 @@ describe("Zotero.DataDirectory", function () {
yield populateDataDirectory(oldDir);
let origFunc = OS.File.move;
let stub1 = sinon.stub(OS.File, "move", function () {
let stub1 = sinon.stub(OS.File, "move").callsFake(function () {
if (OS.Path.basename(arguments[0]) == storageFile1) {
return Zotero.Promise.reject(new Error("Error"));
}