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

Grunt Watch Should Not Watch Test Output Files #9

Open
jthomerson opened this issue Jan 31, 2019 · 2 comments
Open

Grunt Watch Should Not Watch Test Output Files #9

jthomerson opened this issue Jan 31, 2019 · 2 comments
Assignees
Labels

Comments

@jthomerson
Copy link
Member

With grunt develop running, when I run npm test I see the following:

image

It seems like we should not be watching the .nyc_output or coverage folders.

@yokuze
Copy link
Contributor

yokuze commented Feb 7, 2019

This seems to be caused by a combination of 2 factors:

  1. The library that grunt-contrib-watch uses to watch for file changes listens at the directory level rather than a per-file basis. Therefore when we register the watch task for our Gruntfile.js file, it's actually watching for changes in the entire root project folder but still only responding to changes that involve the Gruntfile.js file.
  2. There's a (still unresolved) bug in grunt-contrib-watch that triggers the watch task whenever a new folder is added to a directory that's being watched. That's why you observed the "watch" task getting triggered when .nyc_output and coverage were added. You would not see the "watch" task triggered if those folders existed at the point "watch" was first run, nor when a file inside of either of those folders changed.

There's a PR to fix the issue described in bullet point 2, but it's been open since 2016. There hasn't been activity in grunt-contrib-watch since May 2018, so not sure what the odds are of getting a PR accepted.

As best as I can tell, we likely have the same behavior in every other project that we use Grunt, grunt-contrib-watch, and watch Gruntfile.js.

Should we just close this and move on @jthomerson? Or do you recommend something else?

@jthomerson
Copy link
Member Author

Let's leave our issue open (it is an issue), but not do anything about it. If anyone knows some Grunt people to ping, let's try that. It's a bit ridiculous that those issues are open that long and don't have any feedback or activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants