summaryrefslogtreecommitdiff
path: root/tests/js/hero.mjs
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-03-06 20:19:15 -0300
committerEuAndreh <eu@euandre.org>2024-03-06 20:25:32 -0300
commit8c5c99447bc6f53a291d7f3f629c738e1938a311 (patch)
tree31c25b62066d43516d4703165a2b789b52a022be /tests/js/hero.mjs
parentsrc/hero.mjs: Add simplified implementation of `makePipeReader()` (diff)
downloadpapod-8c5c99447bc6f53a291d7f3f629c738e1938a311.tar.gz
papod-8c5c99447bc6f53a291d7f3f629c738e1938a311.tar.xz
src/hero.mjs: Add minimalistic "ping" action for doing smoke tests in production
Diffstat (limited to 'tests/js/hero.mjs')
-rw-r--r--tests/js/hero.mjs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/js/hero.mjs b/tests/js/hero.mjs
index 14d9a07..4537197 100644
--- a/tests/js/hero.mjs
+++ b/tests/js/hero.mjs
@@ -1196,6 +1196,25 @@ const test_actionsFn = async t => {
]);
});
};
+
+ {
+ t.start(`actionsFn()["ping"]()`);
+
+ await t.test("simple pinging", () => {
+ const contents = [];
+ const logger = { info: x => contents.push(x) };
+ const actions = actionsFn({ logger });
+
+ configLogger({});
+ actions["ping"]("blah");
+ actions["ping"](null);
+
+ assert.deepEqual(contents, [
+ { message: "pong" },
+ { message: "pong" },
+ ]);
+ });
+ };
};
const test_lineHandlerFn = async t => {