From 6a01ae578f615ae7e8aef59c29d01824a3f3b97e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Belin?= Date: Sat, 9 Nov 2024 19:31:36 +0100 Subject: [PATCH] Code optimization --- test/eta_test.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/eta_test.coffee b/test/eta_test.coffee index 270b30c..cbb32f0 100644 --- a/test/eta_test.coffee +++ b/test/eta_test.coffee @@ -9,11 +9,11 @@ describe "eta()", -> after -> controller.abort() server = createServer app.callback() - url = new URL "http://127.0.0.1:3000/" - before (_, done) -> server.listen host: url.hostname, port: 0, signal: controller.signal, -> + url = new URL "http://127.0.0.1:0/" + before -> new Promise (resolve) -> server.listen host: url.hostname, port: Number(url.port), signal: controller.signal, -> {address, port} = server.address() url = new URL "http://#{address}:#{port}/" - done() + resolve() describe "render()", -> it "should have been added to the application context", ->