Open glenjamin opened 2 weeks ago
I've been able to get something close enough to the correct numbers by reading the code closely and assigning slightly different meanings to the timestamps provided:
const {
loadTestEnvironmentStart: testInitStart,
setupAfterEnvEnd: testImportStart,
end: testEnd,
} = testResult.perfStats;
const firstTestStart = testResult.testResults[0].startAt;
🚀 Feature Proposal
In #14622
perfStats
was expanded to provide breakdowns of parts of the test init processHowever, it doesn't include a timer for the interval between calling
import
/require
on the test file, and starting the actual test execution.Motivation
In my experience this timing is a common cause of slow test suite execution, I'm currently exploring ways of collecting timing information about this phase, to help people target improvements in module loading for tests.
Example
No response
Pitch
This needs to live in core, as only
jest-circus
have the relevant context to be able to perform this timing.I'm happy to submit a PR for this if I get the nod that the proposal makes sense