From a16df8aa2fdf5cc9e7c3d3c20cb1cd26ee2ba402 Mon Sep 17 00:00:00 2001 From: chenos Date: Thu, 1 Aug 2024 08:30:09 +0800 Subject: [PATCH] fix: remove sync-manager test case --- .../server/src/__tests__/sync-manager.test.ts | 61 ------------------- 1 file changed, 61 deletions(-) delete mode 100644 packages/core/server/src/__tests__/sync-manager.test.ts diff --git a/packages/core/server/src/__tests__/sync-manager.test.ts b/packages/core/server/src/__tests__/sync-manager.test.ts deleted file mode 100644 index 044a1bcdae..0000000000 --- a/packages/core/server/src/__tests__/sync-manager.test.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * This file is part of the NocoBase (R) project. - * Copyright (c) 2020-2024 NocoBase Co., Ltd. - * Authors: NocoBase Team. - * - * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License. - * For more information, please refer to: https://www.nocobase.com/agreement. - */ - -import { Application } from '../application'; -import { SyncAdapter } from '../sync-manager'; - -class MockAdapter extends SyncAdapter { - private _ready: boolean; - - constructor({ ready = false, ...options } = {}) { - super(options); - this._ready = ready; - } - - get ready() { - return this._ready; - } - - publish(data: Record): void { - return; - } -} - -describe('sync manager', () => { - let app: Application; - - beforeEach(() => { - app = new Application({ - database: { - dialect: 'sqlite', - storage: ':memory:', - }, - resourcer: { - prefix: '/api', - }, - acl: false, - dataWrapping: false, - registerActions: false, - }); - }); - - afterEach(async () => { - return app.destroy(); - }); - - it('sync manager should be initialized with application', async () => { - expect(app.syncManager).toBeDefined(); - }); - - it('init adapter', async () => { - const mockAdapter1 = new MockAdapter(); - app.syncManager.init(mockAdapter1); - expect(() => app.syncManager.init(mockAdapter1)).toThrowError(); - }); -});