Apply appropriate configs for different tests ran as different projects
See original GitHub issueHi Guys.
Seems projects
doesn’t work as intended. I have jest config which is intended to run all my type of tests:
module.exports = {
projects: ['./jest.config.ui.js', './jest.config.unit.js']
};
It is impossible that file of unit
tests would be grabbed by ui
tests, see regex:
ui
: testRegex: '/__tests__/.*-test\\.js?$',
unit
: testMatch: ['**/__tests__/**/?(*.)+(spec).js']
These ui
and unit
configs have different setups. For example for ui
tests I need to resolve all css
files successfully, I do this via:
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'./resources/__mocks__/fileMock.js',
'\\.(css|sass|scss|less)$': 'identity-obj-proxy'
},
unit
tests config doesn’t have this setup.
So, when I run ui
and unit
tests separately - all good.
When I try to run all
tests config - I see that moduleNameMapper
doesn’t work for ui
tests.
In total, expected behaviour: File which is found for UI test should be executed with the help of appropriate config.
UPD: DEMO To see behavior please clone repo https://github.com/deser/jest_issue-7268 and follow steps in README.md
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (1 by maintainers)
Also experiencing similar issues, projects basically does not work.
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. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.