Skip to content

Commit bb65630

Browse files
committedFeb 11, 2021
fix: Remove default root container from InMemoryDataAccessor
1 parent 6424b07 commit bb65630

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed
 

‎src/storage/accessors/InMemoryDataAccessor.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ export class InMemoryDataAccessor implements DataAccessor {
3131

3232
const metadata = new RepresentationMetadata({ path: this.base });
3333
metadata.addQuads(generateResourceQuads(DataFactory.namedNode(this.base), true));
34-
const rootContainer = { entries: {}, metadata };
35-
this.store = { entries: { '': rootContainer }};
34+
this.store = { entries: { }};
3635
}
3736

3837
public async canHandle(): Promise<void> {

‎test/integration/LpdHandlerOperations.test.ts

+9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ describe('An integrated AuthenticatedLdpHandler', (): void => {
1717
'urn:solid-server:default:variable:baseUrl': BASE,
1818
},
1919
) as HttpHandler;
20+
21+
// The tests depend on there being a root container here
22+
await performRequest(
23+
handler,
24+
new URL('http://test.com/'),
25+
'PUT',
26+
{ 'content-type': 'text/turtle', 'transfer-encoding': 'chunked' },
27+
[ ],
28+
);
2029
});
2130

2231
it('can add, read and delete data based on incoming requests.', async(): Promise<void> => {

‎test/integration/WebSocketsProtocol.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ describe('A server with the Solid WebSockets API behind a proxy', (): void => {
2828
});
2929
});
3030

31-
it('returns a 200.', async(): Promise<void> => {
31+
it('returns a 404 if no data was initialized.', async(): Promise<void> => {
3232
const response = await fetch(serverUrl, { headers });
33-
expect(response.status).toBe(200);
33+
expect(response.status).toBe(404);
3434
});
3535

3636
it('sets the Updates-Via header.', async(): Promise<void> => {

0 commit comments

Comments
 (0)
Please sign in to comment.