(pathname: string, match: RegExp, status = 200)
| 28 | await validateResponse('/unknown', /Cannot GET/, 404); |
| 29 | |
| 30 | async function validateResponse(pathname: string, match: RegExp, status = 200): Promise<void> { |
| 31 | const response = await fetch(new URL(pathname, `http://localhost:${port}`)); |
| 32 | const text = await response.text(); |
| 33 | assert.match(text, match); |
| 34 | assert.equal(response.status, status); |
| 35 | } |
| 36 | } |
no test coverage detected