You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using wallaby with the jest framework in a monorepo.
My wallaby config file and jest config (in my package.json) both reside in a path deeper than my editor's project root:
packages/
my-package/
wallaby.conf.js
package.json (contains jest config)
I use <rootDir> in my Jest config to refer to packages/my-package, and I have my jest moduleNameMappers referring to content in <rootDir>/...
Jest resolves those properly, but wallaby does not. I suspect (but have not confirmed) that wallaby is using the project root as <rootDir> instead of the location of packages/my-package.
Here is the error I get from wallaby:
Configuration error:
Could not locate module react (mapped as ./../react-compat/index.js)
Please check:
"moduleNameMapper": {
"/^react$/": "./../react-compat/index.js"
},
"resolver": undefined
I have also tried opening my-package directly in atom as the project root, but I get the same error.
Wallaby maps <rootDir> to its local cache (with instrumented files), unless the path is pointing to node_modules. However, files/folders that are above wallaby config file level are not copied to the wallaby cache, hence the issue.
@csi-lk Yep, the issue is related to a recent update (that was few weeks ago). We'll investigate the ways to fix if (to work without the suggested <rootDir>) for this scenario (wallaby config residing deeper than project's root).
Issue description or question
I am using wallaby with the jest framework in a monorepo.
My wallaby config file and jest config (in my package.json) both reside in a path deeper than my editor's project root:
I use
<rootDir>
in my Jest config to refer topackages/my-package
, and I have my jestmoduleNameMapper
s referring to content in<rootDir>/..
.Jest resolves those properly, but wallaby does not. I suspect (but have not confirmed) that wallaby is using the project root as
<rootDir>
instead of the location ofpackages/my-package
.Here is the error I get from wallaby:
I have also tried opening
my-package
directly in atom as the project root, but I get the same error.Wallaby.js configuration file
Jest config (in
package.json
)Code editor or IDE name and version
Atom v1.24.0
atom-wallaby 1.0.22
OS name and version
macOS Sierra 10.12.6
The text was updated successfully, but these errors were encountered: