-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guide to use Jest with Lerna #3112
Comments
You could look at the Jest repo itself for a start! You cannot overwrite the Jest config for now, for that we may build the multi-config runner #2970. |
Is there a way use |
I have the same issue as @casesandberg. The Jest unit tests in Lerna packages are failing. Any help? |
on the
using the projects this will look for all the jest.config.js in the packages a jest.config.base.js that will be used as a base for all the packages
the Now in each packages I have a
You could get your module name from the package.json for instance So now you can run jest either from the packages itself or from the root and it should work. Hope it helps |
@nolazybits are you sure your projects are even used? When I follow what you did, it just executes everything with the base config. |
@Itrulia Here's what I did in my
|
I also fixed it already, I had to add |
Maybe you need to set babel.config.js: module.exports = {
...require('../../babel.config.js')
}; |
I am not successful in settings things up based on comments here - jest won't detects test files when running
|
Jest common/shared configuration file. *.base.* and *.common.* pattern. See jestjs/jest#3112 for more example.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Do you want to request a feature or report a bug?
docs :)
Basically, I'd like to know what would be the best set up for using Jest and Lerna together. We'd like to have the parent dir with the Jest dependencies and be responsible to run tests.
.babelrc
? Will Jest use that one or the parent one? Will it have conflicts? Maybe one package needs a plugin that other does not.build/index.js
for all packages first? Any alternatives?package.json
of each package? So I can have a different jest set up depending on the package? For example, one package might usesetupFiles
but others will not need it.The text was updated successfully, but these errors were encountered: