Hacker News new | ask | show | jobs
by wrikl 1506 days ago
That seems great, definitely going to check it out!

Do you know if there's a way to use that runner per-file or per-project within jest? Seems like that's the only way it'd be possible to smoothly migrate in a large codebase without rewriting all tests at once.

1 comments

Jest supports multiple “projects” in a single invocation, and they can all use a different reporter.

You can define a base config for your repo, and then inherit two sub-configs from it each with different runners and mutually exclusive selection for tests (by suffix, folder, or any convention that works for you).

See https://jestjs.io/docs/configuration

Thank you! We actually do use the "projects" feature, but we've found a fair number of options don't work when defined at the project level (a good example is `coverageThreshold` - we weren't able to make per-project thresholds work, at least in jest 26).

Glad that this one has the ability to be configured more granually - that'll come in handy for migrating gradually.