From 6e7e6459ad7bccc195219a9f432cef7a1d3cff67 Mon Sep 17 00:00:00 2001 From: wangjinxin613 <1749574663@qq.com> Date: Thu, 25 Jan 2024 14:19:57 +0800 Subject: [PATCH] =?UTF-8?q?test(provide-page2)=EF=BC=9A=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=BC=8F=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 --- pages/composition/provide/provide-page2.test.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pages/composition/provide/provide-page2.test.js b/pages/composition/provide/provide-page2.test.js index df318f8..a8c4285 100644 --- a/pages/composition/provide/provide-page2.test.js +++ b/pages/composition/provide/provide-page2.test.js @@ -1,5 +1,6 @@ const PAGE_PATH = '/pages/composition/provide/provide-page2' -describe('函数方式创建 provide', () => { +describe('函数方式创建 provide', () => { + const isSafari = process.env.uniTestPlatformInfo.indexOf('safari') > -1 const isWeb = process.env.uniTestPlatformInfo.startsWith('web') let page beforeAll(async () => { @@ -51,21 +52,21 @@ describe('函数方式创建 provide', () => { const providePageArrEl = await page.$('.provide-page-arr') const providePageArrText = await providePageArrEl.text() expect(providePageArrText).toBe( - 'providePageArr: ["函数方式定义 provide page arr"]' + isSafari ? 'providePageArr: [ "函数方式定义 provide page arr"]' : 'providePageArr: ["函数方式定义 provide page arr"]' ) }) it('map', async () => { const providePageMapEl = await page.$('.provide-page-map') const providePageMapText = await providePageMapEl.text() expect(providePageMapText).toBe( - isWeb ? 'providePageMap: {"key": "函数方式定义 provide page map"}' : 'providePageMap: {"key":"函数方式定义 provide page map"}' + isWeb ? (isSafari ? 'providePageMap: { "key": "函数方式定义 provide page map"}' : 'providePageMap: {"key": "函数方式定义 provide page map"}') : 'providePageMap: {"key":"函数方式定义 provide page map"}' ) }) it('set', async () => { const providePageSetEl = await page.$('.provide-page-set') const providePageSetText = await providePageSetEl.text() expect(providePageSetText).toBe( - 'providePageSet: ["函数方式定义 provide page set"]' + isSafari ? 'providePageSet: [ "函数方式定义 provide page set"]' : 'providePageSet: ["函数方式定义 provide page set"]' ) }) }) -- GitLab