mirror of
https://github.com/strapi/strapi.git
synced 2025-08-02 05:48:39 +00:00
17 lines
385 B
JavaScript
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;
|
||
|
};
|