From 3bb359bb15448043a0426cf63570f7ed4236960b Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 8 Mar 2024 07:23:43 -0300 Subject: src/hero.mjs: Add buildTable() --- tests/js/hero.mjs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/js/hero.mjs') diff --git a/tests/js/hero.mjs b/tests/js/hero.mjs index 3cc5d30..3d0751c 100644 --- a/tests/js/hero.mjs +++ b/tests/js/hero.mjs @@ -36,6 +36,7 @@ import { makeReopeningPipeReader, makePipeReaderFn, buildRoutes, + buildTable, promisifyServer, buildServer, } from "../../src/hero.mjs"; @@ -1648,6 +1649,17 @@ const test_buildRoutes = async t => { }); }; +const test_buildTable = async t => { + t.start("buildTable()"); + + await t.test('we just add the "interceptors" key to what buildRoutes() gives us', () => { + assert.deepEqual( + buildTable([], [ "i1", "i2" ]), + { interceptors: [ "i1", "i2" ] }, + ); + }); +}; + const test_promisifyServer = async t => { t.start("promisifyServer()"); @@ -1728,6 +1740,7 @@ await runner.runTests([ test_actionsFn, test_lineHandlerFn, test_buildRoutes, + test_buildTable, test_rmIf, test_mkfifo, test_makeLineEmitter, -- cgit v1.2.3