I am trying to get my first Jest Test to pass with React and Babel.
I am getting the following error:
SyntaxError: /Users/manueldupont/test/av
If you're using ts-jest, none of the solutions above will work! You'll need to mock transform.
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
roots: [
"<rootDir>/src"
],
transform: {
".(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/jest-config/file-mock.js",
'.(css|less)$': '<rootDir>/jest-config/style-mock.js'
},
};
module.exports = {
process() {
return `module.exports = 'test-file-stub'`;
},
};
module.exports = {
process() {
return 'module.exports = {};';
}
};
I found this working example