From 6e2c4f0ccf50e62b6a61f5a9f3b569c29e77d660 Mon Sep 17 00:00:00 2001 From: Ruben Verborgh Date: Sun, 20 Dec 2020 14:48:29 +0100 Subject: [PATCH] chore: Remove initServerStore. --- test/configs/Util.ts | 22 --------------------- test/integration/PodCreation.test.ts | 3 +-- test/integration/WebSocketsProtocol.test.ts | 3 +-- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/test/configs/Util.ts b/test/configs/Util.ts index e5706d2b9..a39f87fe1 100644 --- a/test/configs/Util.ts +++ b/test/configs/Util.ts @@ -1,8 +1,6 @@ -import type { Server } from 'http'; import { join } from 'path'; import * as Path from 'path'; import { Loader } from 'componentsjs'; -import fetch from 'cross-fetch'; import type { BodyParser, DataAccessor, @@ -26,7 +24,6 @@ import { ErrorResponseWriter, GetOperationHandler, HeadOperationHandler, - HttpError, InMemoryDataAccessor, LinkRelMetadataWriter, LinkTypeParser, @@ -195,22 +192,3 @@ export const instantiateFromConfig = async(componentUrl: string, configFile: str const configPath = Path.join(__dirname, configFile); return loader.instantiateFromUrl(componentUrl, configPath, undefined, { variables }); }; - -/** - * Initializes the root container of the server. - * Useful for when the RootContainerInitializer was not instantiated. - */ -export const initServerStore = async(server: Server, baseUrl: string, - headers: Record = {}): Promise => { - const res = await fetch(baseUrl, { - method: 'PUT', - headers: { - ...headers, - 'content-type': 'text/turtle', - }, - body: '', - }); - if (res.status >= 400) { - throw new HttpError(res.status, 'Error', res.statusText); - } -}; diff --git a/test/integration/PodCreation.test.ts b/test/integration/PodCreation.test.ts index 9250d1008..f6737f384 100644 --- a/test/integration/PodCreation.test.ts +++ b/test/integration/PodCreation.test.ts @@ -3,7 +3,7 @@ import { join } from 'path'; import fetch from 'cross-fetch'; import type { HttpServerFactory } from '../../src/server/HttpServerFactory'; import { readableToString } from '../../src/util/StreamUtil'; -import { initServerStore, instantiateFromConfig } from '../configs/Util'; +import { instantiateFromConfig } from '../configs/Util'; const port = 6003; const baseUrl = `http://localhost:${port}/`; @@ -21,7 +21,6 @@ describe('A server with a pod handler', (): void => { }, ) as HttpServerFactory; server = factory.startServer(port); - await initServerStore(server, baseUrl); }); afterAll(async(): Promise => { diff --git a/test/integration/WebSocketsProtocol.test.ts b/test/integration/WebSocketsProtocol.test.ts index 83132bc6e..a118c9ce1 100644 --- a/test/integration/WebSocketsProtocol.test.ts +++ b/test/integration/WebSocketsProtocol.test.ts @@ -2,7 +2,7 @@ import type { Server } from 'http'; import fetch from 'cross-fetch'; import WebSocket from 'ws'; import type { HttpServerFactory } from '../../src/server/HttpServerFactory'; -import { initServerStore, instantiateFromConfig } from '../configs/Util'; +import { instantiateFromConfig } from '../configs/Util'; const port = 6001; const serverUrl = `http://localhost:${port}/`; @@ -20,7 +20,6 @@ describe('A server with the Solid WebSockets API behind a proxy', (): void => { }, ) as HttpServerFactory; server = factory.startServer(port); - await initServerStore(server, serverUrl, headers); }); afterAll(async(): Promise => {