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

Allow watch plugin to be configured #6603

Merged
merged 7 commits into from
Jul 3, 2018

Conversation

rogeliog
Copy link
Contributor

@rogeliog rogeliog commented Jul 3, 2018

Summary

  • Update docs for watch plugins.

This should make it enable plugins to customize their keys and also allow for custom behavior within plugins, for example, the usage of globs in jest-watch-typeahead

    "watchPlugins": [
      [
        "jest-watch-typeahead/filename",
        {
          "key": "g",
          "prompt": "to filter with a glob",
          "strategy": "glob"
        }
      ],
      [
        "jest-watch-typeahead/filename",
        {
          "key": "k",
          "prompt": "to have a custom prompt"
        }
      ]
    ],

Relates to jest-community/jest-watch-typeahead#9 and jest-community/jest-watch-typeahead#10

I'm not sure if something else needs to be updated in the config parsing. cc: @thymikee

Test plan

screen shot 2018-07-02 at 9 00 44 pm

@rogeliog rogeliog requested review from SimenB and thymikee July 3, 2018 04:03
@SimenB
Copy link
Member

SimenB commented Jul 3, 2018

Yeeeeees! ❤️

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing docs, other than that, this looks awesome! Love that it's such a small diff

› Press p to filter by a filename regex pattern.
› Press t to filter by a test name regex pattern.
› Press q to quit watch mode.
› Press k to configured prompt.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reads weird, but doesn't matter 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, let me change it to Press k to filter with a custom prompt

@SimenB
Copy link
Member

SimenB commented Jul 3, 2018

Single test failing on CI.

@@ -148,3 +148,35 @@ class MyWatchPlugin {
}
}
```

## Customization
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SimenB I added it under the version-23.0 is this OK? Should I add it under a new different version folder instead? Given that it is not present in 23.0

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codecov-io
Copy link

Codecov Report

Merging #6603 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6603      +/-   ##
==========================================
- Coverage   63.73%   63.72%   -0.01%     
==========================================
  Files         235      235              
  Lines        8931     8933       +2     
  Branches        4        3       -1     
==========================================
+ Hits         5692     5693       +1     
- Misses       3238     3239       +1     
  Partials        1        1
Impacted Files Coverage Δ
packages/jest-config/src/normalize.js 93.11% <100%> (-0.36%) ⬇️
packages/jest-cli/src/watch.js 79.02% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d6e0a1b...66eecf2. Read the comment docs.

Copy link
Collaborator

@thymikee thymikee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍. Fix docs as already discussed and it's good to go :)

@SimenB
Copy link
Member

SimenB commented Jul 3, 2018

I moved the docs and fixed the linting errors in it

@rogeliog
Copy link
Contributor Author

rogeliog commented Jul 3, 2018

Thanks!

@SimenB
Copy link
Member

SimenB commented Jul 3, 2018

@rickhanlonii the silent reporter makes out slow tests time out due to no output :P Do you think we could print e.g ping every 8 minutes or something?

@SimenB
Copy link
Member

SimenB commented Jul 3, 2018

@mjesun this is good to go, just timeouts on CI

schalkneethling referenced this pull request in mdn/interactive-examples Jul 6, 2018
This Pull Request renovates the package group "jest monorepo".


-   [jest-environment-node](https://github.com/facebook/jest) (`devDependencies`): from `23.2.0` to `23.3.0`
-   [jest](https://github.com/facebook/jest) (`devDependencies`): from `23.2.0` to `23.3.0`

# Release Notes
<details>
<summary>facebook/jest</summary>

### [`v23.3.0`](https://github.com/facebook/jest/blob/master/CHANGELOG.md#&#8203;2330)
[Compare Source](jestjs/jest@v23.2.0...v23.3.0)
##### Features

- `[jest-cli]` Allow watch plugin to be configured ([#&#8203;6603](`https://github.com/facebook/jest/pull/6603`))
- `[jest-snapshot]` Introduce `toMatchInlineSnapshot` and `toThrowErrorMatchingInlineSnapshot` matchers ([#&#8203;6380](`https://github.com/facebook/jest/pull/6380`))
##### Fixes

- `[jest-regex-util]` Improve handling already escaped path separators on Windows ([#&#8203;6523](`https://github.com/facebook/jest/pull/6523`))
- `[jest-cli]` Fix `testNamePattern` value with interactive snapshots ([#&#8203;6579](`https://github.com/facebook/jest/pull/6579`))
- `[jest-cli]` Fix enter to interrupt watch mode ([#&#8203;6601](`https://github.com/facebook/jest/pull/6601`))
##### Chore & Maintenance

- `[website]` Switch domain to https://jestjs.io ([#&#8203;6549](`https://github.com/facebook/jest/pull/6549`))
- `[tests]` Improve stability of `yarn test` on Windows ([#&#8203;6534](`https://github.com/facebook/jest/pull/6534`))
- `[*]` Transpile object shorthand into Node 4 compatible syntax ([#&#8203;6582](`https://github.com/facebook/jest/pull/6582`))
- `[*]` Update all legacy links to jestjs.io ([#&#8203;6622](`https://github.com/facebook/jest/pull/6622`))
- `[docs]` Add docs for 23.1, 23.2, and 23.3 ([#&#8203;6623](`https://github.com/facebook/jest/pull/6623`))
- `[website]` Only test/deploy website if relevant files are changed ([#&#8203;6626](`https://github.com/facebook/jest/pull/6626`))
- `[docs]` Describe behavior of `resetModules` option when set to `false` ([#&#8203;6641](`https://github.com/facebook/jest/pull/6641`))

---


</details>




---

This PR has been generated by [Renovate Bot](https://renovatebot.com).
@rogeliog rogeliog mentioned this pull request Sep 20, 2018
7 tasks
@github-actions
Copy link

This pull request 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

Successfully merging this pull request may close these issues.

5 participants