<aside> 💻
Error: Jest encountered an unexpected token
// jest.config.cjs
module.exports = {
preset: "ts-jest",
testEnvironment: "jest-environment-jsdom",
transform: {
"^.+\\\\.(ts|tsx)$": "ts-jest"
}
};
Cannot find module '@/components/...' or its corresponding type declarations
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1"
}
ReferenceError: TextEncoder is not defined
import { TextEncoder, TextDecoder } from 'util';
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;
Property 'toBeInTheDocument' does not exist on type 'Matchers<any>'