From 2c952a69709ffe77cda875ac5227b646ea4669e1 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Wed, 8 May 2024 19:32:44 +0800 Subject: [PATCH] =?UTF-8?q?test(keepAlive):=20=E4=BF=AE=E5=A4=8D=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=BE=8B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/keep-alive/keep-alive.test.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pages/built-in/component/keep-alive/keep-alive.test.js b/pages/built-in/component/keep-alive/keep-alive.test.js index 94f532a..b69a837 100644 --- a/pages/built-in/component/keep-alive/keep-alive.test.js +++ b/pages/built-in/component/keep-alive/keep-alive.test.js @@ -25,7 +25,7 @@ describe('keep-alive', () => { expect(shouldExcludeBtnList.length).toBe(0) const counterBtnList = await page.$$('.counter-btn') - for (const i = 0; i < counterBtnList.length; i++) { + for (let i = 0; i < counterBtnList.length; i++) { await counterBtnList[i].tap() } @@ -33,9 +33,9 @@ describe('keep-alive', () => { await showShouldExcludeBtn.tap() shouldExcludeTexts = await page.$$('.should-exclude-text') - for (const i = 0;i < shouldExcludeTexts.length;i++) { + for (let i = 0;i < shouldExcludeTexts.length;i++) { const text = await shouldExcludeTexts[i].text() - if (i < shouldExcludeBtnList.length - 1) { + if (i < shouldExcludeTexts.length - 1) { expect(text).toBe('count: 0') } else { expect(text).toBe('count: 1') @@ -48,7 +48,7 @@ describe('keep-alive', () => { expect(await deactivatedNum.text()).toBe('deactivated num: 1') let counterTexts = await page.$$('.counter-text') - for (const i = 0; i < counterTexts.length; i++) { + for (let i = 0; i < counterTexts.length; i++) { expect(await counterTexts[i].text()).toBe('count: 1') } @@ -61,7 +61,7 @@ describe('keep-alive', () => { } let messageTexts = await page.$$('.message-text') - for (const i = 0; i < messageTexts.length; i++) { + for (let i = 0; i < messageTexts.length; i++) { expect(await messageTexts[i].text()).toBe('msg: message changed') } @@ -71,21 +71,21 @@ describe('keep-alive', () => { expect(await deactivatedNum.text()).toBe('deactivated num: 2') counterTexts = await page.$$('.counter-text') - for (const i = 0; i < counterTexts.length; i++) { + for (let i = 0; i < counterTexts.length; i++) { expect(await counterTexts[i].text()).toBe('count: 1') } await showMessageBtn.tap() messageTexts = await page.$$('.message-text') - for (const i = 0; i < messageTexts.length; i++) { + for (let i = 0; i < messageTexts.length; i++) { expect(await messageTexts[i].text()).toBe('msg: message changed') } await showShouldExcludeBtn.tap() shouldExcludeTexts = await page.$$('.should-exclude-text') - for (const i = 0; i < shouldExcludeTexts.length; i++) { + for (let i = 0; i < shouldExcludeTexts.length; i++) { expect(await shouldExcludeTexts[i].text()).toBe('count: 0') } } -- GitLab