From 20ef64f04f9087860713362a41f95d4c1a8452fb Mon Sep 17 00:00:00 2001 From: Anton SHEPILOV Date: Fri, 1 Nov 2024 18:54:14 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=85Fixed=20storage=20unit=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/services/storage/oneof-storage-strategy.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tdrive/backend/node/test/unit/core/services/storage/oneof-storage-strategy.test.ts b/tdrive/backend/node/test/unit/core/services/storage/oneof-storage-strategy.test.ts index 3a46b272..57655486 100644 --- a/tdrive/backend/node/test/unit/core/services/storage/oneof-storage-strategy.test.ts +++ b/tdrive/backend/node/test/unit/core/services/storage/oneof-storage-strategy.test.ts @@ -14,7 +14,8 @@ function mockStorage(size: number) { write: jest.fn().mockResolvedValue({ size: size }), read: jest.fn(), exists: jest.fn(), - remove: jest.fn().mockResolvedValue(true) + remove: jest.fn().mockResolvedValue(true), + getId: jest.fn().mockResolvedValue("Mock Storage ID") } as unknown as StorageConnectorAPI; } @@ -56,7 +57,7 @@ describe('OneOfStorageStrategy', () => { const path = 'test/path'; const stream = mockStream(); - await expect(oneOfStorageStrategy.write(path, stream)).rejects.toThrow('Write operation failed for all storages'); + await expect(oneOfStorageStrategy.write(path, stream)).rejects.toThrow('Write test/path failed for all storages'); }); it('should succeed if one storage write fails but the other succeeds', async () => {