From 0568be863ba5e02bdbd3889f66281fae356f7263 Mon Sep 17 00:00:00 2001 From: Geert-Jan Zwiers Date: Fri, 13 May 2022 18:36:00 +0200 Subject: feat(ext/web): add performance.toJSON (#14548) --- cli/tests/unit/performance_test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cli/tests') diff --git a/cli/tests/unit/performance_test.ts b/cli/tests/unit/performance_test.ts index 252a31fc4..917546e2c 100644 --- a/cli/tests/unit/performance_test.ts +++ b/cli/tests/unit/performance_test.ts @@ -27,6 +27,15 @@ Deno.test(function timeOrigin() { assert(Date.now() >= origin); }); +Deno.test(function performanceToJSON() { + const json = performance.toJSON(); + + assert("timeOrigin" in json); + assert(json.timeOrigin === performance.timeOrigin); + // check there are no other keys + assertEquals(Object.keys(json).length, 1); +}); + Deno.test(function performanceMark() { const mark = performance.mark("test"); assert(mark instanceof PerformanceMark); -- cgit v1.2.3