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

🚀 Feature: Change default value for --watch-ignore to **/node_modules, **/.git #5203

Open
3 tasks done
jedwards1211 opened this issue Aug 28, 2024 · 4 comments · May be fixed by #5204
Open
3 tasks done

🚀 Feature: Change default value for --watch-ignore to **/node_modules, **/.git #5203

jedwards1211 opened this issue Aug 28, 2024 · 4 comments · May be fixed by #5204
Labels
semver-major implementation requires increase of "major" version number; "breaking changes" status: accepting prs Mocha can use your help with this one! type: feature enhancement proposal
Milestone

Comments

@jedwards1211
Copy link

jedwards1211 commented Aug 28, 2024

Feature Request Checklist

Overview

In monorepos and other projects that have node_modules and/or .git directories deeper than the root, mocha --watch watches the contents of these directories by default.

(You may say, but in a monorepo you're just running tests in the directory for each individual package, where its node_modules lives, right? But sometimes you want to run integration tests that combine multiple packages in the monorepo.)

This generally causes mocha --watch to take a long time to start up, with no clear indication why.

Suggested Solution

If we changed the default watch-ignore to ["**/node_modules", "**/.git"] it would automatically ignore all such directories

Alternatives

Of course we can override this in userland, but I think it would benefit everyone to just ignore all node_modules and .git directories by default.

Additional Info

No response

@jedwards1211 jedwards1211 added status: in triage a maintainer should (re-)triage (review) this issue type: feature enhancement proposal labels Aug 28, 2024
@JoshuaKGoldberg
Copy link
Member

This sounds very reasonable to me, you have my 👍 vote!

For reference, the documented default right now is [array] [default: ["node_modules",".git"]].

@jedwards1211 jedwards1211 linked a pull request Aug 29, 2024 that will close this issue
3 tasks
@jedwards1211
Copy link
Author

@JoshuaKGoldberg okay thanks! I made a PR: #5204

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Aug 29, 2024

Oh, sorry, I was unclear - that's just one vote from me. We'll still need consensus from @mochajs/maintenance-crew. This is still in triage.

It also could be considered a breaking change, so it might be a while before we can land it.

@JoshuaKGoldberg
Copy link
Member

Coming back to this: no inputs from other folks, so I'm taking the executive step of saying 👍 on changing the default as a breaking change. Tentatively that looks like it'll be for Mocha 12.

Sibling issue for --ignore: #5131.

@JoshuaKGoldberg JoshuaKGoldberg changed the title 🚀 Feature: watch-ignore **/node_modules, **/.git by default 🚀 Feature: Change default value for --watch-ignore to **/node_modules, **/.git Oct 8, 2024
@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Mocha can use your help with this one! and removed status: in triage a maintainer should (re-)triage (review) this issue labels Oct 8, 2024
@JoshuaKGoldberg JoshuaKGoldberg added this to the v12.0.0 milestone Oct 8, 2024
@JoshuaKGoldberg JoshuaKGoldberg added the semver-major implementation requires increase of "major" version number; "breaking changes" label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-major implementation requires increase of "major" version number; "breaking changes" status: accepting prs Mocha can use your help with this one! type: feature enhancement proposal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants