From 219ce8a9ccf4b61a2e28cbb0494eee4ad15868f4 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Thu, 21 Feb 2019 18:14:32 +0000 Subject: [PATCH] Fix tracing fixture (#14917) --- fixtures/tracing/script.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fixtures/tracing/script.js b/fixtures/tracing/script.js index 48d98308ea..7210d39e6a 100644 --- a/fixtures/tracing/script.js +++ b/fixtures/tracing/script.js @@ -36,7 +36,8 @@ function checkSchedulerAPI() { throw 'API is not defined'; } - if (Scheduler.unstable_now() !== performance.now()) { + const abs = Math.abs(Scheduler.unstable_now() - performance.now()); + if (typeof abs !== 'number' || Number.isNaN(abs) || abs > 5) { throw 'API does not work'; }