What happens in jest watch mode?

I am currently dealing with very slow jest spec run times (watch mode) in a large-scale application. I would like to debug and figure out what are the slowest parts of the cycle. I’ve been looking around but I couldn’t find a way to debug what’s going on when jest watch mode kicks in.

Suppose I change the file in either spec or source – what are the stages that are executed in jest before the specs are run? I can see jest progress bar but it’s not clear what’s going on before the progress bar starts moving? What happens when it starts moving? I can see that at the end of the progress bar specs are executed because I finally get console.log outputs.

It would be good to have an understanding of the different watch mode stages in order to fix issues with slowness, etc…

Thank you