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

Future ideas #9

Closed
rogeliog opened this issue May 31, 2018 · 3 comments
Closed

Future ideas #9

rogeliog opened this issue May 31, 2018 · 3 comments

Comments

@rogeliog
Copy link
Member

rogeliog commented May 31, 2018

Context: It seems that at some point, we should add a way to configure watch plugins. (still need to create an issue for that)

example:

"watchPlugins": [
  ["jest-watch-typeahead/filename", {
    "key": "m",
    "otherOption": true
  }
]

I think we can leverage a lot of what we have here to create a robust typeahead solution. It would be awesome to support advance use cases, for example:

  • Multiple jest-watch-typeahad pugins at the same time
  • Allow for custom filers strategies like: glob, regex, startsWith, exclude, etc.

NOTE: This assume that plugins are "configurable"

  "watchPlugins": [
    "jest-watch-typeahead/testname",
    "jest-watch-typeahead/filename",
    ["jest-watch-typeahead",
      {
        "key": "x",
        "type": "filename",
        "prompt": "exclude file globs",
        "strategy": "exclude-glob"
      }
    ],
    ["jest-watch-typeahead",
      {
        "key": "m",
        "type": "testname",
        "prompt": "run typeahead powered by `my-filter`",
        "strategy": "./my-filter.js"
      }
    ],
  ]

This would add 4 plugins

> Press p to filter by filename...
> Press t to filter by test name...
> Press x to exclude file globs...
> Press m to run typeahead powered by `my-filter`...
@rogeliog rogeliog changed the title Robust typeahead solution Typeahead solution and initial roadmap May 31, 2018
@rogeliog rogeliog changed the title Typeahead solution and initial roadmap Future ideas May 31, 2018
@SimenB
Copy link
Member

SimenB commented May 31, 2018

I think this is an awesome idea! Could be used to e.g. apply a global filter for just e2e tests, then filter them without getting all other tests.

We should definitely land config (for runners too) in Jest to unblock stuff like this.

@rogeliog
Copy link
Member Author

Yes, I agree that runners also really need config

@rogeliog
Copy link
Member Author

rogeliog commented Jul 6, 2018

Closing in favor of #15 and #16 now that configs are released in facebook/jest

@rogeliog rogeliog closed this as completed Jul 6, 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

2 participants