From dea2d1e325ce72799890e4a27b16bd39389fc908 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 8 Mar 2024 08:42:13 -0300 Subject: src/hero.mjs: Add timing data to "in-response" log entry --- tests/js/hero.mjs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests/js/hero.mjs') diff --git a/tests/js/hero.mjs b/tests/js/hero.mjs index 9a5cf25..ee35489 100644 --- a/tests/js/hero.mjs +++ b/tests/js/hero.mjs @@ -237,12 +237,15 @@ const test_interceptorsFn = async t => { { status }, ); assert.deepEqual( - contents, + contents.map(o => u.dissoc(o, "timings")), [ { ...req, type: "in-request" }, { id: req.id, status, type: "in-response" }, ], ); + assert.equal(typeof contents[1].timings.ms.before, "number"); + assert.equal(typeof contents[1].timings.ms.after, "number"); + assert.equal(typeof contents[1].timings.ms.duration, "number"); }); }; @@ -501,7 +504,7 @@ const test_wrapHandler = async t => { }, ); assert.deepEqual( - contents, + contents.map(o => u.dissoc(o, "timings")), [ { id: "0", -- cgit v1.2.3