(
pathname: string,
match: RegExp,
allowH2: boolean,
)
| 51 | await validateResponse('/home', /home works/, false); |
| 52 | |
| 53 | async function validateResponse( |
| 54 | pathname: string, |
| 55 | match: RegExp, |
| 56 | allowH2: boolean, |
| 57 | ): Promise<void> { |
| 58 | const response = await fetch(new URL(pathname, `https://localhost:${port}`), { |
| 59 | dispatcher: new Agent({ |
| 60 | connect: { |
| 61 | allowH2, |
| 62 | rejectUnauthorized: false, |
| 63 | }, |
| 64 | }), |
| 65 | }); |
| 66 | |
| 67 | const text = await response.text(); |
| 68 | assert.match(text, match); |
| 69 | assert.equal(response.status, 200); |
| 70 | } |
| 71 | } |
no test coverage detected