-
-
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
Jest Progress bar and live stats not showing up when running in band #9420
Comments
This is due to you having only a single test meaning jest will the test run in band (meaning within the same process as the jest process), in which case we don't show the status bar until tests complete. This is on purpose, see discussion in #1782 and PR #1813. Relevant code is here: However, forcing the flag to be Not sure what, if anything, to do here. @thymikee @jeysal @cpojer thoughts? If we don't wanna change any code we should probably document it somewhere. @jeremygottfried in your case you can just add a second test file and the summary will appear |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Thanks @SimenB , that worked for showing the live stats and progress bar. I agree it would be helpful to document what enables the live stats and progress bar. If the time estimate is long for a single test suite, maybe show it by default? My test suite takes around 4 minutes, which is quite a while to see |
@SimenB @jeremygottfried sorry, what and where exactly are you setting to true to see the green bar again? I tried creating a second dummy test suit, but it did not help. Also adding |
@makar2 I think I just added a second test file, and |
@jeremygottfried hmm, still doesn't work for me. Maybe something else as well? |
Hi @makar2 , are you sure it's not a different issue, like a syntax error? Sometimes things fail silently. |
@jeremygottfried I am positive, tests are otherwise fine |
@SimenB any thoughts? |
@jeremygottfried & @makar2 Did you find a solution for this? I also added a second file and the status showed up. My issue is now, that it doesn't count the tests of the file where I have all my Could this be caused by using TypeScript and therefore |
This issue still continues. My project is in TypeScript and therefore I use ts-jest preset. Not sure what can I do at this moment. versions I run my tests like this: jest --coverage --runInBand --config jest.config.js jest.config.js /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: "ts-jest",
verbose: true,
testTimeout: 60000,
detectOpenHandles: true,
setupFiles: ["dotenv/config"],
testMatch: ["**/*.e2e*.ts"],
testEnvironment: "node",
transform: {
"^.+\\.(t|j)sx?$": "@swc/jest",
},
}; |
Same here, I need |
I'm having the same problem: #10646 |
I don't think this can be done without an unacceptable tradeoff I'm afraid. Running in band means there is only one process and no delegated worker processes. The Jest CLI output is controlled by the same Node VM that is also running your test. So even if we show a progress bar it would be very unreliable because the test might be running synchronous code for many seconds straight, during which we can't update the progress bar. The only way to avoid this issue would be... essentially not running in band, but with one worker. But this would destroy the whole point of running in band, which is to conserve resources (worker spawning CPU overhead, and runtime memory overhead), as well as other benefits it has, like easier debugging without subprocesses. |
Because I don't see any new points that have come up since Simen's comment here, I'll close this as it's intended as a good tradeoff. But as mentioned we're open to a documentation PR that clarifies and explains this behavior. |
Stupid question… is there a way to run Jest "in band" with two workers: one worker for running tests sequentially, and another worker handling the progress updates. Sorry if this doesn't make sense –my understanding of the internals is still lacklustre after all these years and I get confused about the behaviours/limitations of |
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. |
🐛 Bug Report
When I run jest, I don't see the green progress bar or any of the live printout data in my terminal.
The Test Suites, Tests, Snapshots, and Time stats are only printed out after all my tests are complete. Until tests are complete, the only indicator I see is:
There's no way for me to tell whether the tests have stalled or are still running until the entire suite is complete.
I am running jest with puppeteer for end to end testing.
To Reproduce
yarn install
yarn test
(I set up jest global setup/teardown scripts to handle starting the server)Test Code
Global Setup Code
Expected behavior
I expected my jest tests to show progress bar and live stats printouts like this:
Link to repl or repo (highly encouraged)
https://github.com/jeremygottfried/test-jest-cli
envinfo
System: OS: macOS Mojave 10.14.6 CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz Binaries: Node: 13.6.0 - /usr/local/bin/node Yarn: 1.21.1 - /usr/local/bin/yarn npm: 6.13.4 - /usr/local/bin/npm npmPackages: jest: ^24.9.0 => 24.9.0
The text was updated successfully, but these errors were encountered: