From f66791122983bae345b89bc994946d3505b04ff2 Mon Sep 17 00:00:00 2001 From: Joachim Van Herwegen Date: Wed, 27 Jul 2022 11:44:30 +0200 Subject: [PATCH] test: Use AppRunner to set up an integration test --- test/integration/ServerFetch.test.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/test/integration/ServerFetch.test.ts b/test/integration/ServerFetch.test.ts index eecd1e7e0..dabc21b05 100644 --- a/test/integration/ServerFetch.test.ts +++ b/test/integration/ServerFetch.test.ts @@ -1,8 +1,10 @@ import fetch from 'cross-fetch'; import type { App } from '../../src/init/App'; +import { AppRunner } from '../../src/init/AppRunner'; +import { resolveModulePath } from '../../src/util/PathUtil'; import { LDP } from '../../src/util/Vocabularies'; import { getPort } from '../util/Util'; -import { getDefaultVariables, getTestConfigPath, instantiateFromConfig } from './Config'; +import { getDefaultVariables } from './Config'; const port = getPort('ServerFetch'); const baseUrl = `http://localhost:${port}/`; @@ -12,12 +14,16 @@ describe('A Solid server', (): void => { let app: App; beforeAll(async(): Promise => { - const instances = await instantiateFromConfig( - 'urn:solid-server:test:Instances', - getTestConfigPath('server-memory.json'), + // Using AppRunner here so it is also tested in an integration test + app = await new AppRunner().create( + { + mainModulePath: resolveModulePath(''), + logLevel: 'error', + typeChecking: false, + }, + resolveModulePath('config/default.json'), getDefaultVariables(port, baseUrl), - ) as Record; - ({ app } = instances); + ); await app.start(); });