Open pkruithof opened 10 months ago
Exactly same issue for me, any clue ?
In your jest.config.js you can try and finally it work for me
transform: {
// Transform ES6 and TypeScript files
'^.+\\.(js|jsx|ts|tsx)$': 'babel-jest',
},transformIgnorePatterns: [
// Do not ignore ES6 modules within node_modules that need to be transformed
"node_modules/(?!(@symfony/ux-translator)/)"
],
Apologies if this turns out to be a stupid configuration issue at our end, but hopefully this will help others besides us, if it gets resolved. Some background: we are using Yarn PnP and Zero-installs with Typescript, so our dependencies live in
.yarn/cache/
, committed in git, including the new ux-translator component. We have integrated it in our app and it's working great, the only issue is that Jest does not understand how to load it:I have tried all sorts of config tweaks, using both typescript and just javascript, different typescript loaders (currently
ts-jest
, but we tried babel as well). But honestly I don't know enough about frontend these days to actually debug and fix this. I hope that someone recognizes this error and can point me in the right direction to fix it. Because I doubt this is a bug in the translator code.