autocorector
Version:
autoCOREctor de asignaturas y MOOCs de la ETSIT-UPM
20 lines (18 loc) • 807 B
JavaScript
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';
import { TextEncoder } from 'util';
//needed because there is a bug in react-router https://remarkablemark.org/blog/2025/02/02/fix-jest-errors-in-react-router-7-upgrade/
global.TextEncoder = TextEncoder;
global.console = {
// eslint-disable-next-line no-undef
//log: jest.fn(), // console.log are ignored in tests
log: console.log,
// Keep native behaviour for other methods, use those to print out things in your own tests, not `console.log`
error: console.error,
warn: console.warn,
info: console.info,
debug: console.debug,
};