docbrown/testSetup.js
ktmouk 151a118f57
Fix the last line of editor is not visible (#19023)
Co-authored-by: Lawrence <lawrence@forem.com>
2023-02-02 06:10:24 -06:00

20 lines
570 B
JavaScript

/* eslint-env node */
import 'jest-axe/extend-expect';
import './app/assets/javascripts/lib/xss';
global.setImmediate = global.setTimeout;
global.ResizeObserver = class ResizeObserver {
disconnect() {}
observe() {}
unobserve() {}
};
// TODO: Remove this once https://github.com/nickcolley/jest-axe/issues/147 is fixed.
const { getComputedStyle } = window;
window.getComputedStyle = (elt) => getComputedStyle(elt);
process.on('unhandledRejection', (error) => {
// Errors thrown here are typically fetch responses that have not been mocked.
throw error;
});