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

Support globs, regexes and other search strategies #15

Open
rogeliog opened this issue Jul 6, 2018 · 0 comments
Open

Support globs, regexes and other search strategies #15

rogeliog opened this issue Jul 6, 2018 · 0 comments

Comments

@rogeliog
Copy link
Member

rogeliog commented Jul 6, 2018

There are a couple of issues in facebook/jest that propose the idea of supporting globs as a filtering mechanism. For example jestjs/jest#6422 and jestjs/jest#926

Now that configs for watch plugins got released, I think we can leverage that.

"watchPlugins": [
  ["jest-watch-typeahead/filename", {
     "key": "g",
    "filter": "glob",
    "prompt": "filter by glob"
  }]
]

The implementation should not be that hard, given that we can use shouldRunTestSuite for it, it does come with a couple of problems though.

  • testPathPattern is a regex, which means that we would need to rely on shouldRunTestSuite when using a "filter" type that is not regex.
    • This means that pressing "c" to clear would only work when using regex. I think this is fine, we can show a stlightly different UI for the typeahead when it is not a regex for supporting that.
          > Press "g" to filter by glob (current filter "**/e2e/**/*.js")
      
      This is similar to how the jest-watch-select-projects work. Althought we would also need another UI tweak to clear the filter
This was referenced Jul 6, 2018
@rogeliog rogeliog changed the title Support globs and regexes Support globs, regexes and other search strategies Jul 12, 2018
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

No branches or pull requests

1 participant