-
Notifications
You must be signed in to change notification settings - Fork 455
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
ts-jest 23.xx.xx never finishes during CI tests but 22.xx.xx does #845
Comments
Hi @jussikinnula, to be able to help you, we need more information, like your jest and ts config, project structure, ... or even better, a link to your repository, or to a minimal repository reproducing your issue. |
I'm using an ejected version of
I don't really know if I have any other custom jest configs though |
create-react-app does make some custom config, also |
Hi After upgrading from
With each tests, time of running tests goes up, locally on my Macbook it always finish in around 120s. Config of jest: ( for "jest": {
"setupTestFrameworkScriptFile": "./node_modules/jest-enzyme/lib/index.js",
"unmockedModulePathPatterns": [
"react",
"enzyme",
"jest-enzyme"
],
"testEnvironmentOptions": {
"resources": "usable"
},
"setupFiles": [
"<rootDir>/test/setupTests.js"
],
"moduleNameMapper": {
"^([A-Z]{1}[a-z]+)/(.+)$": "<rootDir>/src/$1/$2",
"@components/(.*)": "<rootDir>/src/Core/components/$1",
"@components": "<rootDir>/src/Core/components",
"^Authentication": "<rootDir>/src/Authentication",
"^Home": "<rootDir>/src/Home",
"^Shipping": "<rootDir>/src/Shipping",
"^Products": "<rootDir>/src/Products",
"^pages": "<rootDir>/src/pages",
"^lib/(.*)": "<rootDir>/src/lib/$1",
"^fixtures/(.*)\\.png": "<rootDir>/test/__fixtures__/$1.js",
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/test/__mocks__/fileMock.js",
"\\.(css|less)$": "<rootDir>/test/__mocks__/styleMock.js"
},
"transformIgnorePatterns": [
"<rootDir>/node_modules/(?!lodash-es)"
],
"transform": {
"^.+\\.js?$": "babel-jest",
"^.+\\.tsx?$": "ts-jest"
},
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json"
],
"globals": {
"NODE_ENV": "test"
}
} |
So I was only able to "fix" it by going through a brand new |
Hey, I have the same thing and I'm not using create-react-app. Here is my config, please let me know if I can provide more info: jest.config.js
.babelrc.base.js
package.json
|
@lluzak @adrienharnay any chances we can have your sample repo ? |
Yeah I will try to set one up... Jest is so painful to set up on a new project, so much variables :( Will get back to you after the week-end! |
After trying to reproduce the issue for 2 hours, I gave up and switched to using |
We have the same issue on our project when upgrading from Unfortunately, I don't have a good sample project to share. However, I did want to share the fact that for us this started happening between 23.1.4 and 23.10.5. |
I had a similar problem, where it was taking forever to run through my tests. As it turned out, ts-jest was hitting my lodash-es imports, and attempting to run and cache the entire of lodash. In my project I had the luxury of being able to remove all of lodash as it was underutilized, so I don't have a "fix", but that was certainly the culprit for me. |
I definitely think someone has to provide a sample repo - otherwise we've got no way to try and fix this. |
Maybe this issue relates to #908? |
Hi guys, would you please help testing with changes mentioned in #1310 (comment) |
Not sure who else this helps, but I had the exact same issue as described in this issue regarding Circle CI, and the best fix that worked for me was to update the {
'ts-jest': {
globals: {
isolatedModules: true
}
}
} Which I found via: #908 (comment) The testing time in Circle literally went from 10 minutes and timing out to 15 seconds! Same coverage and test results. |
The whole lodash is cached because jest passes the whole lodash module to transformer. ts-jest handles anything that is passed to transformer by jest. I will close this issue as not clear to reproduce. If anyone has a repo to share, we would love to help. |
Issue:
I've got a setup using CircleCI. The tests all pass locally but when I tried to upgrade to 23.10.4, the tests in CI say that it has been
Too long with no output (exceeded 10m0s)
. The tests normally only take like 20 seconds. There is no error, but it just says that it has timed out. For some reason, it works totally fine with 22.0.1 though.FYI, I'm using the command
CI=true yarn test
Expected behavior:
Tests should end when running the from CI.
The text was updated successfully, but these errors were encountered: