summaryrefslogtreecommitdiff
path: root/cli/tests/unit/performance_test.ts
diff options
context:
space:
mode:
authorGeert-Jan Zwiers <geertjanzwiers@protonmail.com>2022-05-06 19:37:18 +0200
committerGitHub <noreply@github.com>2022-05-06 19:37:18 +0200
commitdd1d6a0f67cb386941ddc08aa453612f8398144f (patch)
tree450ebcac29f6c812245939449a08d83e4e5e3e61 /cli/tests/unit/performance_test.ts
parent23c77df6643f5b5a8846f67a738fe2e9c1e3c716 (diff)
feat(web): add `performance.timeOrigin` (#14489)
Add support for the `performance.timeOrigin` web API. Co-authored-by: Jovi De Croock <decroockjovi@gmail.com>
Diffstat (limited to 'cli/tests/unit/performance_test.ts')
-rw-r--r--cli/tests/unit/performance_test.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/cli/tests/unit/performance_test.ts b/cli/tests/unit/performance_test.ts
index 4c7d08d4e..252a31fc4 100644
--- a/cli/tests/unit/performance_test.ts
+++ b/cli/tests/unit/performance_test.ts
@@ -20,6 +20,13 @@ Deno.test({ permissions: { hrtime: false } }, async function performanceNow() {
assert(totalTime >= 10);
});
+Deno.test(function timeOrigin() {
+ const origin = performance.timeOrigin;
+
+ assert(origin > 0);
+ assert(Date.now() >= origin);
+});
+
Deno.test(function performanceMark() {
const mark = performance.mark("test");
assert(mark instanceof PerformanceMark);