提交 24fb1597 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test: configure screenshot directory

上级 343b6fd2
const {
toMatchImageSnapshot
} = require('jest-image-snapshot');
expect.extend({
toMatchImageSnapshot
const path = require('path');
const {
configureToMatchImageSnapshot
} = require('jest-image-snapshot');
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}__`
expect.extend({
toMatchImageSnapshot: configureToMatchImageSnapshot({
customSnapshotIdentifier(args) {
return args.currentTestName.replace(/\//g, '-').replace(' ', '-');
},
customSnapshotsDir: path.join(__dirname, folderName),
customDiffDir: path.join(__dirname, `${folderName}/`, 'diff'),
}),
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册