We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm getting this error in my Jest tests when trying to us va.track:
va.track
Here is my jest.config.ts:
// jest.config.ts import type { Config } from "@jest/types"; import nextJest from "next/jest"; // Sync object const customJestConfig: Config.InitialOptions = { verbose: true, testPathIgnorePatterns: ["<rootDir>/.next/", "<rootDir>/node_modules/"], setupFiles: ["<rootDir>/.jest/setEnvVars.ts"], setupFilesAfterEnv: ["<rootDir>/.jest/setupTests.ts"], moduleDirectories: ["node_modules", "<rootDir>"], testEnvironment: "jest-environment-jsdom", transformIgnorePatterns: ["<rootDir>/node_modules/(?!isbot|swiper)"], }; // Providing the path to your Next.js app which will enable loading next.config.js and .env files const createJestConfig = nextJest({ dir: "./" })(customJestConfig); module.exports = async () => { // Create Next.js jest configuration presets const jestConfig = await createJestConfig(); // Custom `moduleNameMapper` configuration const moduleNameMapper = { ...jestConfig.moduleNameMapper, "swiper/react": "<rootDir>/node_modules/swiper", "\\.(css|less|scss|sass)$": "identity-obj-proxy", }; return { ...jestConfig, moduleNameMapper, testTimeout: 20000 }; };
Any idea if this is something on my end?
The text was updated successfully, but these errors were encountered:
For others that stumble on this, was as simple as adding "@vercel/analytics": "identity-obj-proxy", to the moduleNameMapper.
"@vercel/analytics": "identity-obj-proxy",
const moduleNameMapper = { ...jestConfig.moduleNameMapper, "swiper/react": "<rootDir>/node_modules/swiper", "@vercel/analytics": "identity-obj-proxy", "\\.(css|less|scss|sass)$": "identity-obj-proxy", };
Sorry, something went wrong.
Sneaky stuff that should be documented but is not. Thanks for the solution!
No branches or pull requests
I'm getting this error in my Jest tests when trying to us
va.track
:Here is my jest.config.ts:
Any idea if this is something on my end?
The text was updated successfully, but these errors were encountered: