Skip to content

Instantly share code, notes, and snippets.

@ManotLuijiu
Created March 2, 2021 14:01
Show Gist options
  • Save ManotLuijiu/765fb89072506f59b287e4c24ba85f27 to your computer and use it in GitHub Desktop.
Save ManotLuijiu/765fb89072506f59b287e4c24ba85f27 to your computer and use it in GitHub Desktop.
Jest config for NextJS, need to install "identity-obj-proxy"
module.exports = {
testPathIgnorePatterns: ['<rootDir>/.next/', '<rootDir>/node_modules/'],
setupFilesAfterEnv: ['<rootDir>/setupTests.js'],
transform: {
'^.+\\.(js|jsx|ts|tsx)$': '<rootDir>/node_modules/babel-jest',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/fileTransformer.js',
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment