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
@SimenB Thanks for the slowTestThreshold option in #9366. I'm trying it out, but it seems to be only applying to a test suite, not individual tests. The docs say "test", so I was assuming an individual it or test function is what it's measuring. In this setup, package.json specifies:
Three tests run in this one test suite, all were < 1000 ms (slowTestThreshold = 2), so each test was nice and fast. There was some test suite overhead, which pushed the suite over 2 seconds, which is why it's showing as slow. That's fine, but I'd also like to see if the individual tests are slow. See next image.
I know my overall test suite here is super long, that's why I'm hoping to use slowTestThreshold to work on my longer tests incrementally. As you can see, the arrow points to a test that is 2202 ms long, but nothing distinguishes that row from the rest. Only the test suite time is flagged as slow (55.193 s in this case).
To Reproduce
How to reproduce:
Create a test file in a new repo, add a test that goes longer than 1 sec (say a supertest request, or sorting a huge array)
Run npx jest in that repo
See output (see screenshots).
I can't share my code due to confidentiality. But the timing is accurate, and you'll see what I mean in the screenshots.
Expected behavior
I expect that each individual test that is longer than the slowTestThreshold setting in package.json will show that result as slow, not just the test suite as slow. In other words, I want to see all the slow tests highlighted somehow in the runner printout.
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
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.
🐛 Bug Report
@SimenB Thanks for the slowTestThreshold option in #9366. I'm trying it out, but it seems to be only applying to a test suite, not individual tests. The docs say "test", so I was assuming an individual
it
ortest
function is what it's measuring. In this setup,package.json
specifies:Screenshots:
Three tests run in this one test suite, all were < 1000 ms (slowTestThreshold = 2), so each test was nice and fast. There was some test suite overhead, which pushed the suite over 2 seconds, which is why it's showing as slow. That's fine, but I'd also like to see if the individual tests are slow. See next image.
I know my overall test suite here is super long, that's why I'm hoping to use slowTestThreshold to work on my longer tests incrementally. As you can see, the arrow points to a test that is 2202 ms long, but nothing distinguishes that row from the rest. Only the test suite time is flagged as slow (55.193 s in this case).
To Reproduce
How to reproduce:
npx jest
in that repoI can't share my code due to confidentiality. But the timing is accurate, and you'll see what I mean in the screenshots.
Expected behavior
I expect that each individual test that is longer than the slowTestThreshold setting in package.json will show that result as slow, not just the test suite as slow. In other words, I want to see all the slow tests highlighted somehow in the runner printout.
Link to repl or repo (highly encouraged)
envinfo
The text was updated successfully, but these errors were encountered: