diff --git a/test/cli.test.js b/test/cli.test.js index f1c710252f..53968d6d6b 100644 --- a/test/cli.test.js +++ b/test/cli.test.js @@ -121,16 +121,18 @@ describe('cli', () => { }) test('scripts from https', async () => { - $`cat ${path.resolve('test/fixtures/echo.http')} | nc -l 8080` + const server = $`cat ${path.resolve('test/fixtures/echo.http')} | nc -l 8080` let out = await $`node build/cli.js --verbose http://127.0.0.1:8080/echo.mjs` assert.match(out.stderr, /test/) + await server.kill() }) test('scripts from https not ok', async () => { - $`echo $'HTTP/1.1 500\n\n' | nc -l 8081` + const server = $`echo $'HTTP/1.1 500\n\n' | nc -l 8081` let out = await $`node build/cli.js http://127.0.0.1:8081`.nothrow() assert.match(out.stderr, /Error: Can't get/) + await server.kill() }) test('scripts with no extension', async () => {