From 647a70bf836030a6e1e996724ea51bc0b9861317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E6=A0=91=E4=BA=BA?= Date: Mon, 5 Jun 2023 00:04:59 +0100 Subject: [PATCH] test: ignore coverage to test nextTickFn --- src/util/nextTick.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/nextTick.ts b/src/util/nextTick.ts index 59b1102..0b50258 100644 --- a/src/util/nextTick.ts +++ b/src/util/nextTick.ts @@ -1,10 +1,13 @@ type NextTickFn = (callback: () => void) => void; + +/* c8 ignore start */ const nextTickFn = typeof setImmediate !== 'undefined' ? (setImmediate as NextTickFn) : typeof requestAnimationFrame !== 'undefined' ? (requestAnimationFrame as NextTickFn) : (setTimeout as NextTickFn); +/* c8 ignore stop */ export async function nextTickAsync() { return new Promise((resolve) => nextTickFn(resolve));