From 87c3aee0a21184cc38d63c23581049adbdbc59a4 Mon Sep 17 00:00:00 2001 From: wangjinxin613 <1749574663@qq.com> Date: Thu, 25 Jan 2024 14:41:07 +0800 Subject: [PATCH] =?UTF-8?q?test(watch-post-effect)=EF=BC=9A=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E7=A4=BA=E4=BE=8B=E5=85=BC=E5=AE=B9=20safari?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reactivity/watch-post-effect/watch-post-effect.test.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pages/composition-api/reactivity/watch-post-effect/watch-post-effect.test.js b/pages/composition-api/reactivity/watch-post-effect/watch-post-effect.test.js index 8d95e62..58bdf98 100644 --- a/pages/composition-api/reactivity/watch-post-effect/watch-post-effect.test.js +++ b/pages/composition-api/reactivity/watch-post-effect/watch-post-effect.test.js @@ -1,6 +1,7 @@ const PAGE_PATH = '/pages/composition-api/reactivity/watch-post-effect/watch-post-effect' -describe('watchPostEffect', () => { +describe('watchPostEffect', () => { + const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 const isWeb = process.env.uniTestPlatformInfo.startsWith('web') let page = null beforeAll(async () => { @@ -78,7 +79,7 @@ describe('watchPostEffect', () => { const objBool = await page.$('#obj-bool') expect(await objBool.text()).toBe('obj.bool: false') const objArr = await page.$('#obj-arr') - expect(await objArr.text()).toBe('obj.arr: [0]') + expect(await objArr.text()).toBe(isSafari ? 'obj.arr: [ 0]' : 'obj.arr: [0]') const watchObjRes = await page.$('#watch-obj-res') // TODO web端和安卓端JSON.stringify对属性的排序不一致 @@ -99,7 +100,7 @@ describe('watchPostEffect', () => { expect(await objStr.text()).toBe('obj.str: num: 1') expect(await objNum.text()).toBe('obj.num: 1') expect(await objBool.text()).toBe('obj.bool: true') - expect(await objArr.text()).toBe('obj.arr: [0,1]') + expect(await objArr.text()).toBe(isSafari ? 'obj.arr: [ 0, 1]' : 'obj.arr: [0,1]') expect(await watchObjRes.text()).toBe( isWeb ? -- GitLab