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

Bring back typeahead as a watch-mode plugin #4931

Closed
ramusus opened this issue Nov 21, 2017 · 11 comments
Closed

Bring back typeahead as a watch-mode plugin #4931

ramusus opened this issue Nov 21, 2017 · 11 comments

Comments

@ramusus
Copy link

ramusus commented Nov 21, 2017

I tried to reinstall jest many times, tried to run it in no-cache mode.

I'm running jest:
jest --watch ./assets --notify

Config:

  "jest": {
    "setupTestFrameworkScriptFile": "<rootDir>/assets/tests/setup.js",
    "moduleNameMapper": {
      "\\.(css|less|scss)$": "<rootDir>/assets/mocks/styleMock.js",
      "^((?:libs|stores|components|tests).*)$": "<rootDir>/assets/$1",
      "^react-pdf/build/entry.webpack$": "<rootDir>/node_modules/react-pdf"
    }
  },
Active Filters: filename /./assets/

Pattern Mode Usage
 › Press Esc to exit pattern mode.
 › Press Enter to filter by a filenames regex pattern.

 pattern › *test.jsx

And no any results are displayed, unlike it was using version 20. But if I push enter the pattern will be applied and files will be found successfully.

@thymikee
Copy link
Collaborator

Please search this issue tracker more thoroughly and you’ll find that this feature has been temporarily disabled because of license migration to MIT. We’re working on watch more plugin system to make it work again.

@ramusus
Copy link
Author

ramusus commented Nov 23, 2017

@thymikee thanks for explanation

@ramusus
Copy link
Author

ramusus commented Nov 24, 2017

I had searched but found no results. @thymikee can you please provide ticket number, so I can follow, when functionality will be returned back?

@thymikee
Copy link
Collaborator

We're not currently tracking this issue.

@thymikee thymikee changed the title After upgrade from jest 20.0.4 to 21.2.1 typeahead stop displaying any file results Bring back typeahead as a watch-mode plugin Nov 24, 2017
@thymikee thymikee reopened this Nov 24, 2017
@SimenB
Copy link
Member

SimenB commented Dec 19, 2017

Help from the community would be greatly appreciated here. You can use the pluggable interface introduced in #4841. The plugin would be separate from the core Jest repo, but we would love to link to it (and probably host it in https://github.com/jest-community/).

@mattphillips
Copy link
Contributor

Hey @SimenB I've just been taking a look into this and at the new watch mode pluggable interface.

I'm not sure how a separate plugin would be able to implement the old typeahead functionality without re-implementing a lot of Jest's internals. The previous implementation depended on the SearchSources type (amongst other things) which seems to be derived from the contexts array.

type SearchSources = Array<{|
   context: Context,
   searchSource: SearchSource
|}>;

Currently a watch mode plugin only receives the globalConfig and an end callback, which doesn't seem enough information to determine which tests to run/show based on the user's filter. Perhaps if searchSources are passed into the active plugin too (here) then this might be possible.

I'm happy to spend some time to get this working but perhaps I am missing something obvious 😆 any help you can offer on explaining the approach to building this would be greatly appreciated 😄

@rogeliog
Copy link
Contributor

Hey! Yeah I think a lot of stuff would need to change in order to support this. I'll work on trying to get the infrastructure to a point where it supports the plugins and hopefully make it easier to figure out what's needed to bring the typeahead back

@SimenB
Copy link
Member

SimenB commented Jan 30, 2018

For those following along: #5399

@ProTip
Copy link

ProTip commented Jan 30, 2018

I would just like to say that this was my favorite feature in jest; gonna rollback until it is re-introduced.

@SimenB
Copy link
Member

SimenB commented May 30, 2018

Available as of Jest 23.

https://github.com/jest-community/jest-watch-typeahead

(still somewhat experimental, but I was unable to break it when testing it last night. Bug reports (and fixes) welcome!)

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants