From 960622e733a310cc43980aabac65c936709e8e24 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Thu, 9 May 2024 12:45:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20setInterval=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uts-tests/utssdk/Global.uts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/uni_modules/uts-tests/utssdk/Global.uts b/uni_modules/uts-tests/utssdk/Global.uts index b36b15d..8cc0cbd 100644 --- a/uni_modules/uts-tests/utssdk/Global.uts +++ b/uni_modules/uts-tests/utssdk/Global.uts @@ -3,6 +3,22 @@ import { describe, test, expect, Result } from './tests.uts' export function testGlobal(): Result { return describe("Global", () => { + + test('setInterval', () => { + + // #ifdef APP-ANDROID + let aCount = 0 + let taskId = setInterval(function(){ + aCount += 1 + },0) + setTimeout(function(){ + console.log(aCount) + console.log(taskId) + clearInterval(taskId) + expect(aCount > 10).toEqual(true); + },200) + // #endif + }) test('parseInt', () => { expect(parseInt("123.456")).toEqual(123); expect(parseInt("123")).toEqual(123); -- GitLab