summaryrefslogtreecommitdiff
path: root/cli/tests/unit/performance_test.ts
diff options
context:
space:
mode:
authorGeert-Jan Zwiers <geertjanzwiers@protonmail.com>2022-05-13 18:36:00 +0200
committerGitHub <noreply@github.com>2022-05-13 18:36:00 +0200
commit0568be863ba5e02bdbd3889f66281fae356f7263 (patch)
tree27e19ef52beea9fbd0a4c281829be59660718de9 /cli/tests/unit/performance_test.ts
parent939a070c8cbe77626e07a01646c324b2ae5ac740 (diff)
feat(ext/web): add performance.toJSON (#14548)
Diffstat (limited to 'cli/tests/unit/performance_test.ts')
-rw-r--r--cli/tests/unit/performance_test.ts9
1 files changed, 9 insertions, 0 deletions
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);