From df6096a0729a09bd7d63fb5b39e767bb88c9ae54 Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Sun, 15 Dec 2024 22:55:05 +0300 Subject: [PATCH] test: add delay for nc init --- test/cli.test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/cli.test.js b/test/cli.test.js index 98b3f08aec..c96b4f01ef 100644 --- a/test/cli.test.js +++ b/test/cli.test.js @@ -126,14 +126,15 @@ describe('cli', () => { test('scripts from https', async () => { const server = $`cat ${path.resolve('test/fixtures/echo.http')} | nc -l 8080` const out = - await $`node build/cli.js --verbose http://127.0.0.1:8080/echo.mjs` + await $`sleep 10 && 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 () => { const server = $`echo $'HTTP/1.1 500\n\n' | nc -l 8081` - const out = await $`node build/cli.js http://127.0.0.1:8081`.nothrow() + const out = + await $`sleep 10 && node build/cli.js http://127.0.0.1:8081`.nothrow() assert.match(out.stderr, /Error: Can't get/) await server.kill() })