From 9625dcb362d5fe51be7b7fbdbb04492cfbf19644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Mon, 22 Jul 2024 20:28:19 +0200 Subject: [PATCH] Fix mocha test --- src/remotestorage.ts | 1 - test/unit/dropbox.test.ts | 9 ++++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/remotestorage.ts b/src/remotestorage.ts index 40a4bab13..238b73cf9 100644 --- a/src/remotestorage.ts +++ b/src/remotestorage.ts @@ -294,7 +294,6 @@ export class RemoteStorage { */ access: Access; /** - * @ignore */ sync: Sync; /** diff --git a/test/unit/dropbox.test.ts b/test/unit/dropbox.test.ts index 4cd2d3665..e9a86d208 100644 --- a/test/unit/dropbox.test.ts +++ b/test/unit/dropbox.test.ts @@ -5,9 +5,10 @@ import chaiAsPromised from 'chai-as-promised'; import sinon from 'sinon'; import fetchMock from 'fetch-mock'; import config from "../../src/config"; -import RemoteStorage from '../../src/remotestorage'; import Dropbox from "../../src/dropbox"; - +import InMemoryStorage from '../../src/inmemorystorage'; +import RemoteStorage from '../../src/remotestorage'; +import Sync from '../../src/sync'; const SETTINGS_KEY = 'remotestorage:dropbox'; const ACCOUNT_URL = 'https://api.dropboxapi.com/2/users/get_current_account'; @@ -205,7 +206,9 @@ describe('Dropbox backend', () => { const rs2 = new RemoteStorage(); rs2.setApiKeys({dropbox: 'swcj8jbc9i1jf1m'}); // an app would do this rs2.backend = 'dropbox'; - rs2.sync = { sync: sinon.spy() }; + rs2.local = new InMemoryStorage(); + rs2.sync = new Sync(rs2); + rs2.sync.sync = sinon.spy(); Dropbox._rs_init(rs2); const fetchDeltaSpy = sandbox.spy(rs2.dropbox, 'fetchDelta');