mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Resolve merge conflicts caused by move to guardedStream
This commit is contained in:
parent
f4afc3ce16
commit
cdf7e77e6b
10
index.ts
10
index.ts
@ -121,16 +121,12 @@ export * from './src/storage/AtomicResourceStore';
|
||||
export * from './src/storage/Conditions';
|
||||
export * from './src/storage/DataAccessorBasedStore';
|
||||
export * from './src/storage/FileIdentifierMapper';
|
||||
export * from './src/storage/Lock';
|
||||
export * from './src/storage/LockingResourceStore';
|
||||
export * from './src/storage/PassthroughStore';
|
||||
export * from './src/storage/PatchingStore';
|
||||
export * from './src/storage/RepresentationConvertingStore';
|
||||
export * from './src/storage/ResourceLocker';
|
||||
export * from './src/storage/ResourceStore';
|
||||
export * from './src/storage/RoutingResourceStore';
|
||||
export * from './src/storage/SingleThreadedResourceLocker';
|
||||
export * from './src/storage/WrappedExpiringResourceLocker';
|
||||
|
||||
// Util/Errors
|
||||
export * from './src/util/errors/ConflictHttpError';
|
||||
@ -143,6 +139,12 @@ export * from './src/util/errors/UnauthorizedHttpError';
|
||||
export * from './src/util/errors/UnsupportedHttpError';
|
||||
export * from './src/util/errors/UnsupportedMediaTypeHttpError';
|
||||
|
||||
// Util/Locking
|
||||
export * from './src/util/locking/Lock';
|
||||
export * from './src/util/locking/ResourceLocker';
|
||||
export * from './src/util/locking/SingleThreadedResourceLocker';
|
||||
export * from './src/util/locking/WrappedExpiringResourceLocker';
|
||||
|
||||
// Util
|
||||
export * from './src/util/AllVoidCompositeHandler';
|
||||
export * from './src/util/AsyncHandler';
|
||||
|
@ -1,16 +1,16 @@
|
||||
import streamifyArray from 'streamify-array';
|
||||
import type { Representation } from '../../src/ldp/representation/Representation';
|
||||
import { RepresentationMetadata } from '../../src/ldp/representation/RepresentationMetadata';
|
||||
import { InMemoryDataAccessor } from '../../src/storage/accessors/InMemoryDataAccessor';
|
||||
import { DataAccessorBasedStore } from '../../src/storage/DataAccessorBasedStore';
|
||||
import { LockingResourceStore } from '../../src/storage/LockingResourceStore';
|
||||
import type { ResourceStore } from '../../src/storage/ResourceStore';
|
||||
import { UrlContainerManager } from '../../src/storage/UrlContainerManager';
|
||||
import { APPLICATION_OCTET_STREAM } from '../../src/util/ContentTypes';
|
||||
import type { ExpiringResourceLocker } from '../../src/util/locking/ExpiringResourceLocker';
|
||||
import type { ResourceLocker } from '../../src/util/locking/ResourceLocker';
|
||||
import { SingleThreadedResourceLocker } from '../../src/util/locking/SingleThreadedResourceLocker';
|
||||
import { WrappedExpiringResourceLocker } from '../../src/util/locking/WrappedExpiringResourceLocker';
|
||||
import { MetadataController } from '../../src/util/MetadataController';
|
||||
import { guardedStreamFrom } from '../../src/util/StreamUtil';
|
||||
import { CONTENT_TYPE } from '../../src/util/UriConstants';
|
||||
|
||||
describe('A LockingResourceStore', (): void => {
|
||||
@ -25,11 +25,7 @@ describe('A LockingResourceStore', (): void => {
|
||||
|
||||
const base = 'http://test.com/';
|
||||
path = `${base}path`;
|
||||
const metadataController = new MetadataController();
|
||||
const containerManager = new UrlContainerManager(base);
|
||||
source = new DataAccessorBasedStore(
|
||||
new InMemoryDataAccessor(base, metadataController), base, metadataController, containerManager,
|
||||
);
|
||||
source = new DataAccessorBasedStore(new InMemoryDataAccessor(base), base);
|
||||
|
||||
locker = new SingleThreadedResourceLocker();
|
||||
expiringLocker = new WrappedExpiringResourceLocker(locker, 1000);
|
||||
@ -38,7 +34,7 @@ describe('A LockingResourceStore', (): void => {
|
||||
|
||||
// Make sure something is in the store before we read from it in our tests.
|
||||
const metadata = new RepresentationMetadata({ [CONTENT_TYPE]: APPLICATION_OCTET_STREAM });
|
||||
const data = streamifyArray([ 1, 2, 3 ]);
|
||||
const data = guardedStreamFrom([ 1, 2, 3 ]);
|
||||
await store.setRepresentation({ path }, { metadata, data, binary: true });
|
||||
});
|
||||
|
||||
@ -48,6 +44,8 @@ describe('A LockingResourceStore', (): void => {
|
||||
// Spy on a real ResourceLocker and ResourceStore instance
|
||||
const acquireSpy = jest.spyOn(expiringLocker, 'acquire');
|
||||
const getRepresentationSpy = jest.spyOn(source, 'getRepresentation');
|
||||
getRepresentationSpy.mockReturnValue(new Promise((resolve): any => resolve({ data:
|
||||
streamifyArray([ 1, 2, 3 ]) } as Representation)));
|
||||
|
||||
const representation = await store.getRepresentation({ path }, {});
|
||||
const errorCallback = jest.fn();
|
||||
@ -74,6 +72,8 @@ describe('A LockingResourceStore', (): void => {
|
||||
// Spy on a real ResourceLocker and ResourceStore instance
|
||||
const acquireSpy = jest.spyOn(expiringLocker, 'acquire');
|
||||
const getRepresentationSpy = jest.spyOn(source, 'getRepresentation');
|
||||
getRepresentationSpy.mockReturnValue(new Promise((resolve): any => resolve({ data:
|
||||
streamifyArray([ 1, 2, 3 ]) } as Representation)));
|
||||
|
||||
const representation = await store.getRepresentation({ path }, {});
|
||||
const errorCallback = jest.fn();
|
||||
|
Loading…
x
Reference in New Issue
Block a user