Jest: Jest as a daemon

Created on 9 Apr 2018  路  5Comments  路  Source: facebook/jest

Do you want to request a _feature_ or report a _bug_?

Request a _feature_.

Hi, it'd be great if jest had some sort of daemon mode that would allow it to run and accept filenames to run tests for and emit results via json.

The use case for this is for integration into text editors like https://github.com/jojojames/flycheck-jest

At the moment, it seems we just start a new jest process with the specific file we want to test which incurs some amount of startup time.

I apologize if there's already a good way to do this, I looked around and wasn't able to find one.

Thanks!

Feature Request New API proposal

Most helpful comment

@SimenB, @richardscarrott this would be great to speed up IDE tests duration. Now for example in IntelliJ when we run test, startup takes about 2seconds and test just for example 20ms.
With running deamon in the background, jest would be ready to run tests and without node / jest startup tests duration will be reduced about 2second.

All 5 comments

sounds like watch mode and setting pattern through a signal or something instead of pressing p and entering one.

@rogeliog thoughts on this as a watch plugin? What (if any) changes would need to happen in jest to handle it?

@thymikee @rickhanlonii thoughts?

Yeah I think this could be done in user land and doesn't need to be in core

Can re-open if there's a compelling reason to add to core 馃憤

@SimenB, @richardscarrott this would be great to speed up IDE tests duration. Now for example in IntelliJ when we run test, startup takes about 2seconds and test just for example 20ms.
With running deamon in the background, jest would be ready to run tests and without node / jest startup tests duration will be reduced about 2second.

Yeah, we definitely want this at some point. Current status: https://github.com/facebook/jest/issues/5048#issuecomment-475065417

(so a first iteration will have a programmatic API, and we can follow up with some way of starting jest as a daemon after that)

Was this page helpful?
0 / 5 - 0 ratings