33 Star 227 Fork 62

Gitee 极速下载/joplin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/laurent22/joplin
克隆/下载
jest.base-setup.js 828 Bytes
一键复制 编辑 原始数据 按行查看 历史
/* eslint-disable jest/require-top-level-describe */
module.exports = () => {
// Disable the additional information that Jest adds to each console
// statement. It's rarely needed and if it is it can be commented out here.
const jestConsole = console;
beforeEach(() => {
global.console = require('console');
});
afterEach(() => {
global.console = jestConsole;
});
};
// jsdom extensions
if (typeof document !== 'undefined') {
// Prevents the CodeMirror error "getClientRects is undefined".
// See https://github.com/jsdom/jsdom/issues/3002#issue-652790925
document.createRange = () => {
const range = new Range();
range.getBoundingClientRect = jest.fn();
range.getClientRects = () => {
return {
length: 0,
item: () => null,
[Symbol.iterator]: jest.fn(),
};
};
return range;
};
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/joplin.git
[email protected]:mirrors/joplin.git
mirrors
joplin
joplin
dev

搜索帮助