2023-01-30 14:16:31 +01:00

17 lines
385 B
JavaScript

/* eslint-disable no-undef */
'use strict';
// Codemirror inner dependency, reference: https://github.com/jsdom/jsdom/issues/3002
// Otherwise it throws: TypeError: range(...).getBoundingClientRect is not a function
document.createRange = () => {
const range = new Range();
range.getClientRects = jest.fn(() => ({
item: () => null,
length: 0,
}));
return range;
};