I've been searching for an answer for a couple hours, but didn't find anything applicable and recent. I'm moving from Angular 13 to 14, and after I did wasn't able to run my Jest tests, so I went back to the Getting Started guide, uninstalled the NPM packages and then reinstalled to get the latest version, and my setup-jest.ts file didn't need changing, so I left it as-is, and now when I try to run tests, I get: ● Test suite failed to run Jest encountered an unexpected token Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax. Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration. By default "node_modules" folder is ignored by transformers. ... SyntaxError: Cannot use import statement outside a module > 1 | import 'jest-preset-angular/setup-jest'; | ^ 2 | import './jestGlobalMocks'; 3 | import '@testing-library/jest-dom/extend-expect'; 4 | Here's my Jest config (within package.json): "jest": { "preset": "jest-preset-angular", "roots": [ "<rootDir>/src/" ], "setupFilesAfterEnv": ["<rootDir>/src/setup-jest.ts"], "moduleDirectories": ["node_modules", "<rootDir>"], "moduleFileExtensions": ["ts", "html", "js", "json", "mjs"], "transformIgnorePatterns": [ "node_modules/(?!(jqwidgets-scripts)/)" ], "moduleNameMapper": { "^@services/(.*)$": "<rootDir>/src/app/services/$1", "^@components/(.*)$": "<rootDir>/src/app/components/$1", "^@shared/(.*)$": "<rootDir>/src/app/shared/$1", "^@app/(.*)$": "<rootDir>/src/app/$1", "^@base/(.*)$": "<rootDir>/src/$1" } }, Continue reading...