-
Hi all, I'm having an issue with jest and mapping file names in workspaces. I believe this is a yarn issue since the error is related to modules not being found. I would really appreciate it if anyone had any insights here. I'm trying to use the This works fine, but it breaks when I try to import a
I'm not sure why I can't import this file. Is there some setting or feature of yarn I need to use to handle this? I've attached my sample project below. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Jest is hiding the real error, if you run
The fix is to resolve the mapping up front diff --git a/app/jest.config.js b/app/jest.config.js
index 31ca6db..eb2411f 100644
--- a/app/jest.config.js
+++ b/app/jest.config.js
@@ -4,7 +4,7 @@ const config = {
displayName: 'react-flow-builder',
moduleNameMapper: {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
- "\\.(css|less)$": "identity-obj-proxy"
+ "\\.(css|less)$": require.resolve("identity-obj-proxy")
},
};
|
Beta Was this translation helpful? Give feedback.
Jest is hiding the real error, if you run
PNP_DEBUG_LEVEL=1 yarn test
you'll see this error:The fix is to resolve the mapping up front