diff options
author | EuAndreh <eu@euandre.org> | 2024-03-08 08:42:13 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-03-08 08:42:13 -0300 |
commit | dea2d1e325ce72799890e4a27b16bd39389fc908 (patch) | |
tree | 3db22ef57c1e556bdd37b5c2aa7ecf2962740bd0 /tests/js/hero.mjs | |
parent | src/utils.mjs: Add dissoc() (diff) | |
download | papod-dea2d1e325ce72799890e4a27b16bd39389fc908.tar.gz papod-dea2d1e325ce72799890e4a27b16bd39389fc908.tar.xz |
src/hero.mjs: Add timing data to "in-response" log entry
Diffstat (limited to 'tests/js/hero.mjs')
-rw-r--r-- | tests/js/hero.mjs | 7 |
1 files changed, 5 insertions, 2 deletions
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", |