CommunitySolidServer/test/unit/server/HttpRequest.test.ts
Joachim Van Herwegen 953458231b fix: Prevent HttpRequest from being closed
In case a stream the request is being piped into closes,
we don't want to close the request since it shares a socket
with the response.
2021-04-09 09:04:25 +02:00

11 lines
359 B
TypeScript

import { isHttpRequest } from '../../../src/server/HttpRequest';
describe('HttpRequest', (): void => {
describe('#isHttpRequest', (): void => {
it('can identify HttpRequests.', async(): Promise<void> => {
expect(isHttpRequest({})).toBe(false);
expect(isHttpRequest({ socket: {}, method: 'GET', url: '/url' })).toBe(true);
});
});
});