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

Pass changed file as template parameter to watchers #3

Merged
merged 8 commits into from
Jan 30, 2021

Conversation

artsparkAI
Copy link
Contributor

This change makes it so that the watcher command can be passed the changed file path as an argument. This is very useful for running tests without having to re-run the entire suite. It's especially useful for fast iteration when used in conjunction with single test isolation such as it.only.

Changed file as argument

The path of the changed file can be inserted into positional arguments using the template parameter {path}. This speeds up iteration in testing, especially if using single test isolation (for example, by using it.only("test") in mocha.)

Example:

module.exports = {
  watcher: {
    test: {
      tasks: [{ command: 'test', params: { testFiles: ['{path}'] } }],
      files: ['./test/**/*'],
      verbose: true
    }
  }
}

@xanderdeseyn
Copy link
Owner

Hi, this looks good, thanks for the PR! Is there a reason you removed the dist folder from gitignore?

If possible, please add dist back and remove the build files from the PR, then I will merge :)

@artsparkAI
Copy link
Contributor Author

Oh sorry I will fix that. That was just a temporary hack for myself so I could point to github directly rather than having to go through NPM publish/install cycle.

@artsparkAI
Copy link
Contributor Author

@N1ghtly Okay done

@xanderdeseyn xanderdeseyn merged commit fab1c05 into xanderdeseyn:main Jan 30, 2021
@xanderdeseyn
Copy link
Owner

Merged, thank you for the contribution!

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

Successfully merging this pull request may close these issues.

2 participants