From ec60684cb7c2fb51546ccbec80feae4a2c33d820 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Fri, 17 Nov 2023 17:44:37 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=87=AA=E5=8A=A8=E5=8C=96=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E5=9F=BA=E5=87=86=E5=9B=BE=E5=8C=BA=E5=88=86=E7=8E=AF?= =?UTF-8?q?=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jest-setup.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/jest-setup.js b/jest-setup.js index 5e4c8351..c5b8872c 100644 --- a/jest-setup.js +++ b/jest-setup.js @@ -6,7 +6,13 @@ const { const hbuilderx_version = process.env.HX_Version const uniTestPlatformInfo = process.env.uniTestPlatformInfo ? process.env.uniTestPlatformInfo.replace(/\s/g,'_') : '' const folderName = `__image_snapshots__/${hbuilderx_version}/__${uniTestPlatformInfo}__` -const baseFolderName = `__image_snapshots__/base/__${uniTestPlatformInfo}__` +let environment = 'official' +if(hbuilderx_version.includes('dev')){ + environment = 'dev' +}else if(hbuilderx_version.includes('alpha')){ + environment = 'alpha' +} +const baseFolderName = `__image_snapshots__/base/${environment}/__${uniTestPlatformInfo}__` expect.extend({ toMatchImageSnapshot: configureToMatchImageSnapshot({ @@ -16,4 +22,4 @@ expect.extend({ customSnapshotsDir: path.join(__dirname, baseFolderName), customDiffDir: path.join(__dirname, `${folderName}/`, 'diff'), }), -}); \ No newline at end of file +}); -- GitLab