Skip to content

Commit

Permalink
✅Fixed storage unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shepilov committed Nov 1, 2024
1 parent 8afb9bd commit 8113d8a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 () => {
Expand Down

0 comments on commit 8113d8a

Please sign in to comment.