From 033ceb43ba6cd0191a99e64270079cbb99ded3c4 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 6 Mar 2024 20:02:18 -0300 Subject: src/hero.mjs: Change server.listen() to receive no arguments --- tests/js/hero.mjs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests/js') diff --git a/tests/js/hero.mjs b/tests/js/hero.mjs index d4c6b57..67cf690 100644 --- a/tests/js/hero.mjs +++ b/tests/js/hero.mjs @@ -1575,8 +1575,9 @@ const test_buildServer = async t => { await t.test("empty values", async () => { const socket = "tests/hero-4.socket"; const pipe = "tests/hero-4.pipe"; - const server = buildServer("my app", []); - await server.listen(socket, pipe); + const name = "my-empty-app"; + const server = buildServer({ name, socket, pipe }); + await server.listen(); const response = await socketRequest(socket, "/anything"); await server.close(); @@ -1586,11 +1587,12 @@ const test_buildServer = async t => { await t.test("integrated application server", async () => { const socket = "tests/hero-5.socket"; const pipe = "tests/hero-5.pipe"; + const name = "the-app"; const pathHandler = req => ({ status: 200, body: "something" }); const routes = [ [ "GET", "/path", pathHandler ] ]; - const server = buildServer("the-app", routes, defaultInterceptors); + const server = buildServer({ name, routes, socket, pipe }); - await server.listen(socket, pipe); + await server.listen(); const response = await socketRequest(socket, "/path"); await server.close(); -- cgit v1.2.3