Skip to content

Future ideas #9

@rogeliog

Description

@rogeliog

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`...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions