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

Webhook mocks/fixtures #7

Open
gr2m opened this issue Nov 22, 2017 · 0 comments
Open

Webhook mocks/fixtures #7

gr2m opened this issue Nov 22, 2017 · 0 comments
Labels
project Goes beyond a single bug fix or new feature. Help welcome by existing contributors. Type: Feature New feature or request

Comments

@gr2m
Copy link
Contributor

gr2m commented Nov 22, 2017

moving from gr2m/octokit-webhooks.js-legacy#8 @rtsao, @JasonEtco


Per probot/probot#316 (comment), for testing probot apps, it would be ideal to have a node-github-like API to programmatically generate webhook fixtures, for example something like:

let robot = /* ... */

let github = new MockGitHub();
let repo = github.mocks.repo({
  org: 'test-org',
  name: 'test-repo'
});

robot.auth = () => Promise.resolve(github);

let webhook = github.issues.edited(
  repo.issue({
    body: 'new issue body'
  })
);

await robot.recieve(webhook);

/* ... assertions ... */
@gr2m gr2m added the Type: Feature New feature or request label May 5, 2020
@gr2m gr2m added the project Goes beyond a single bug fix or new feature. Help welcome by existing contributors. label Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project Goes beyond a single bug fix or new feature. Help welcome by existing contributors. Type: Feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants
@gr2m and others