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

Add documentation for watch plugins #5895

Merged
merged 6 commits into from
May 24, 2018
Merged

Conversation

rogeliog
Copy link
Contributor

WIP: Do not merge

Contributes to #5478

This PR adds documentation for watch plugins.

It is still in a really rough spot, but feedback is more that welcome!!
screen shot 2018-03-28 at 4 25 22 pm

@rogeliog rogeliog mentioned this pull request Mar 28, 2018
7 tasks
@rogeliog rogeliog changed the title Add skeleton Add documentatin for watch plugins Mar 28, 2018
@rogeliog rogeliog changed the title Add documentatin for watch plugins Add documentation for watch plugins Mar 28, 2018
class. This receives a `jestHooks` argument that allows the plugin to hook into
specific parts of the lifecycle of a test run.

```javascript
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about moving this up to it's own section "Plugin Class" that includes the whole interface?

@rickhanlonii
Copy link
Member

rickhanlonii commented Mar 29, 2018

This is great!

The only thing missing is an explanation of how you register a plugin -- will that be through an option similar to runner and reporters like watchers?

@cpojer
Copy link
Member

cpojer commented Apr 15, 2018

Can we get this merged?

@rogeliog
Copy link
Contributor Author

Almost, although I wonder if we need points 1 and 2 of #5478 to be resolved first

@SimenB
Copy link
Member

SimenB commented Apr 29, 2018

Should we stick the docs into master, and do a backport to 22.4 if needed later?

@rogeliog
Copy link
Contributor Author

rogeliog commented Apr 30, 2018

I think as long as we can get this item in #5478 done, then things should be good! Use utf-8 encoding instead of hex to make it play well with plugins. (needs discussion) ... but I've been scared about that one

@cpojer
Copy link
Member

cpojer commented May 22, 2018

Just pinging this again. Can we merge this PR this week?

@SimenB
Copy link
Member

SimenB commented May 22, 2018

what about just setting it to utf8 and see what happens? I suppose we can also set it manually to hex if any of our plugins needs it anyways?

Below are the hooks available in Jest.
#### `jestHooks.shouldRunTestSuite(testPath)`

Returns a boolean to specify if a test should be run or not. It can return a
Copy link
Collaborator

Choose a reason for hiding this comment

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

"It can return" -> "It returns"?

@codecov-io
Copy link

codecov-io commented May 24, 2018

Codecov Report

Merging #5895 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5895   +/-   ##
=======================================
  Coverage   64.22%   64.22%           
=======================================
  Files         220      220           
  Lines        8481     8481           
  Branches        3        3           
=======================================
  Hits         5447     5447           
  Misses       3033     3033           
  Partials        1        1

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 77d2e8e...9cee1de. Read the comment docs.

@thymikee thymikee merged commit c52d925 into jestjs:master May 24, 2018
class MyWatchPlugin {
getUsageInfo(globalConfig) {
return {
key: 's'.codePointAt(0),
Copy link
Member

Choose a reason for hiding this comment

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

this is wrong, now

Copy link
Member

Choose a reason for hiding this comment

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

what should it be?

Copy link
Member

Choose a reason for hiding this comment

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

Just key: 's'

Copy link
Member

Choose a reason for hiding this comment

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

beauty

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

7 participants