diff --git a/jest-setup.js b/jest-setup.js index 5e4c8351ed2a751e63527545cb0c2d1ef7eb297c..c5b8872c3bf029e27902f4acef9ea85934f18d1a 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 +});