97 Star 457 Fork 115

GVPantv / 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;
},
});
JavaScript
1
https://gitee.com/antv/f2.git
git@gitee.com:antv/f2.git
antv
f2
F2
master

搜索帮助