1 Star 0 Fork 122

tang/F2

forked from antv/F2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
jest-setup.js 724 Bytes
一键复制 编辑 原始数据 按行查看 历史
索丘 提交于 2022-01-24 10:12 . fix: tooltip 顶部被截断了 (#1346)
// eslint-disable-next-line
const { configureToMatchImageSnapshot } = require('jest-image-snapshot');
// eslint-disable-next-line
const CanvasConverter = require('canvas-to-buffer');
const toMatchImageSnapshot = configureToMatchImageSnapshot({
failureThreshold: 0.001,
failureThresholdType: 'percent',
});
expect.extend({
toMatchImageSnapshot(received) {
const converter = new CanvasConverter(received.canvas, {
image: { types: ['png'] },
});
const execPath = process.execPath;
// toMatchImageSnapshot 需要使用 node 环境
process.execPath = 'node';
const result = toMatchImageSnapshot.call(this, converter.toBuffer());
process.execPath = execPath;
return result;
},
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/EasyBIM/f2.git
git@gitee.com:EasyBIM/f2.git
EasyBIM
f2
F2
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385