Skip to content

Commit

Permalink
Improve docs on probot simulate command (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonEtco authored and bkeepers committed Jan 29, 2018
1 parent 5e9c0b6 commit 8a5ad67
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docs/simulating-webhooks.md
Expand Up @@ -8,10 +8,15 @@ As you are developing your app, you will likely want to test it by repeatedly tr

To save a copy of the payload, go to the [settings](https://github.com/settings/apps) page for your App, and go to the **Advanced** tab. Click on one of the **Recent Deliveries** to expand it and see the details of the webhook event. Copy the JSON from the the **Payload** and save it to a new file. (`test/fixtures/issues.labeled.json` in this example).

**Note**: This will only simulate the JSON payload, not the headers that are also sent by GitHub webhooks.

![](https://user-images.githubusercontent.com/173/28491924-e03e91f2-6ebe-11e7-9570-6d48da68c6ca.png)

Next, simulate this event being delivered by running:

```
$ node_modules/.bin/probot simulate issues test/fixtures/issues.labeled.json ./index.js
```
$ node_modules/.bin/probot simulate <event-name> <path-to-fixture> <path-to-app>

Note that `event-name` here is just the name of the event (like pull_request or issues) and not the action (like labeled). For example, to simulate the pull_request.labeled event, run:

$ node_modules/.bin/probot simulate pull_request test/fixtures/pull_request.labeled.json ./index.js

0 comments on commit 8a5ad67

Please sign in to comment.