fix: Ensure main handler ends

This commit is contained in:
Ruben Verborgh
2020-09-02 15:58:51 +02:00
committed by Joachim Van Herwegen
parent 199d657097
commit 273626a799
2 changed files with 10 additions and 1 deletions

View File

@@ -77,6 +77,13 @@ describe('ExpressHttpServer', (): void => {
});
});
it('returns a 404 when the handler does not do anything.', async(): Promise<void> => {
handler.handle = async(input): Promise<void> => {
expect(input).toBeDefined();
};
await request(server).get('/').expect(404);
});
it('catches errors thrown by its handler.', async(): Promise<void> => {
handler.handle = async(): Promise<void> => {
throw new Error('dummyError');