mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Add ExpressHttpServerFactory.
This commit is contained in:
committed by
Joachim Van Herwegen
parent
4ef4d44a3a
commit
e39e7963eb
@@ -3,7 +3,7 @@ import type { ResourceIdentifier } from '../../../src/ldp/representation/Resourc
|
||||
import { VoidLoggerFactory } from '../../../src/logging/VoidLoggerFactory';
|
||||
|
||||
describe('Setup', (): void => {
|
||||
let httpServer: any;
|
||||
let serverFactory: any;
|
||||
let store: any;
|
||||
let aclManager: any;
|
||||
let setup: Setup;
|
||||
@@ -14,15 +14,15 @@ describe('Setup', (): void => {
|
||||
aclManager = {
|
||||
getAcl: jest.fn(async(): Promise<ResourceIdentifier> => ({ path: 'http://test.com/.acl' })),
|
||||
};
|
||||
httpServer = {
|
||||
listen: jest.fn(),
|
||||
serverFactory = {
|
||||
startServer: jest.fn(),
|
||||
};
|
||||
setup = new Setup(httpServer, store, aclManager, new VoidLoggerFactory(), 'http://localhost:3000/', 3000);
|
||||
setup = new Setup(serverFactory, store, aclManager, new VoidLoggerFactory(), 'http://localhost:3000/', 3000);
|
||||
});
|
||||
|
||||
it('starts an HTTP server.', async(): Promise<void> => {
|
||||
await setup.setup();
|
||||
expect(httpServer.listen).toHaveBeenCalledWith(3000);
|
||||
expect(serverFactory.startServer).toHaveBeenCalledWith(3000);
|
||||
});
|
||||
|
||||
it('invokes ACL initialization.', async(): Promise<void> => {
|
||||
|
||||
Reference in New Issue
Block a user