Skip to content

Commit 871c579

Browse files
committed
Fix test after isThereData implementation
1 parent 4b92f21 commit 871c579

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

__test__/backup.test.ts

+10
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ let spyOnLogError = null;
2929
let spyOnShowError = null;
3030
let spyOnSaveBackupInfo = null;
3131
let spyOnDataGet = null;
32+
let spyOnIsThereData = null;
3233

3334
const spyOnsSettingsValue = jest.spyOn(joplin.settings, "value");
3435
const spyOnGlobalValue = jest.spyOn(joplin.settings, "globalValue");
@@ -1119,6 +1120,15 @@ describe("Backup", function () {
11191120
});
11201121

11211122
describe("create backup readme", () => {
1123+
beforeEach(async () => {
1124+
spyOnIsThereData = jest
1125+
.spyOn(backup, "isThereData")
1126+
.mockImplementation(() => Promise.resolve(true));
1127+
});
1128+
afterEach(async () => {
1129+
spyOnIsThereData.mockRestore();
1130+
});
1131+
11221132
it.each([
11231133
{ backupRetention: 1, createSubfolderPerProfile: false },
11241134
{ backupRetention: 2, createSubfolderPerProfile: false },

0 commit comments

Comments
 (0)