feat: Integrate setup behaviour

This adds options for enabling setup to the config folder.
All default configs with permanent storage (file/sparql)
are configured to require setup at server start.
Memory-based configs merely have it as an option.
This commit is contained in:
Joachim Van Herwegen
2021-09-15 16:56:18 +02:00
parent 4e1a2f5981
commit b592d449eb
47 changed files with 883 additions and 246 deletions

View File

@@ -0,0 +1,18 @@
import { StaticHandler } from '../../../../src/util/handlers/StaticHandler';
describe('A StaticHandler', (): void => {
it('can handle everything.', async(): Promise<void> => {
const handler = new StaticHandler();
await expect(handler.canHandle(null)).resolves.toBeUndefined();
});
it('returns the stored value.', async(): Promise<void> => {
const handler = new StaticHandler('apple');
await expect(handler.handle()).resolves.toEqual('apple');
});
it('returns undefined if there is no stored value.', async(): Promise<void> => {
const handler = new StaticHandler();
await expect(handler.handle()).resolves.toBeUndefined();
});
});