feat: Move runtime config into dedicated component, Closes #67

* Move runtime config into dedicated component, Closes #67

* Migrate FileResourceStore to RuntimeConfig
This commit is contained in:
Ruben Taelman
2020-08-26 10:25:47 +02:00
committed by GitHub
parent 4f8ebff7f7
commit 5126356c94
14 changed files with 194 additions and 84 deletions

View File

@@ -1,3 +1,4 @@
import { RuntimeConfig } from '../../../src/init/RuntimeConfig';
import { Setup } from '../../../src/init/Setup';
describe('Setup', (): void => {
@@ -15,16 +16,16 @@ describe('Setup', (): void => {
httpServer = {
listen: jest.fn(),
};
setup = new Setup(httpServer, store, aclManager);
setup = new Setup(httpServer, store, aclManager, new RuntimeConfig());
});
it('starts an HTTP server.', async(): Promise<void> => {
await setup.setup(3000, 'http://localhost:3000/');
await setup.setup();
expect(httpServer.listen).toHaveBeenCalledWith(3000);
});
it('invokes ACL initialization.', async(): Promise<void> => {
await setup.setup(3000, 'http://localhost:3000/');
await setup.setup();
expect(aclManager.getAcl).toHaveBeenCalledWith({ path: 'http://localhost:3000/' });
expect(store.setRepresentation).toHaveBeenCalledTimes(1);
});