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 Yarn with workspaces enabled, Lerna, TypeScript and React in this project.
I have looked at all the issues surrounding this topic in wallabyjs/public and I cannot find a solution that works. I am using react but using enzyme for testing. It is failing in my setup.ts on this line:
import'@myapp/common';
Where Lerna has added @myapp/packagename to the node_modules folder at the root, so it should find it easily?
This still doesn't exactly work, I have to change a file pattern to this:
{ pattern: 'packages/**/*.ts?(x)', load: false }
and add an index.ts file in the root of each package exporting everything from the ./src folder to get this to work, or I would have to put the individual packages all explicitly in the addAliases method like so: .addAliases({ '@myapp/common': w.projectCacheDir + '/packages/common/src' }).
Any ideas on how to get the aliasing to work without having to explicitly set each alias or without having to add an index file in the package root folder please?
should be enough. However, since you have main field pointing to src in your packages package.json files, you'll need to let Wallaby know about your package.json files (otherwise standard node resolution is used as if package.json was missing). So adding:
Issue description or question
I am using Yarn with workspaces enabled, Lerna, TypeScript and React in this project.
I have looked at all the issues surrounding this topic in wallabyjs/public and I cannot find a solution that works. I am using react but using enzyme for testing. It is failing in my
setup.ts
on this line:Where Lerna has added
@myapp/packagename
to the node_modules folder at the root, so it should find it easily?Wallaby.js configuration file
Code editor or IDE name and version
Visual Studio Code v1.24.0?
OS name and version
Windows 10
The text was updated successfully, but these errors were encountered: