Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree shanking for re-exported entry #11334

Closed
yola-0316 opened this issue Apr 23, 2021 · 2 comments
Closed

Tree shanking for re-exported entry #11334

yola-0316 opened this issue Apr 23, 2021 · 2 comments

Comments

@yola-0316
Copy link

🚀 Feature Proposal

As the following description. In watch mode, Container A related test suits will not run while Button Change:
image

As a developer, I only want to rerun related tests.

Now:

  • jest collectModules logic not expose to user.
  • jest dependencyExtractor use regex match.

Hope:

  • dependencyExtractor extract dependencies with import export info.
  • collectModules let use decided which file need to run.

Motivation

My project use index.tsx re-exported a lot of components.
In jest watch mode, many relationship test suites run when I change only one basic component.

If could tree shaking the re-exported entry, would reduce many times.

Example

According to above picture, When Button changed, Container A related test will not running.
Only Tab component changed, Container A will run.

Pitch

Why does this feature belong in the Jest core platform?

Common feature proposals that do not typically make it to core:

  • New matchers (see jest-extended)
  • Changes to the default reporter (use custom reporters instead)
  • Changes to node/jsdom test environments (use custom environments instead)
@ahnpnl
Copy link
Contributor

ahnpnl commented Apr 23, 2021

#11234 talks about similar thing (entry/barrel) but more about performance in that issue.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants