Skip to content

Webhook mocks/fixtures #7

Open
Open
@gr2m

Description

@gr2m

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 ... */

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: FeatureNew feature or requestprojectGoes beyond a single bug fix or new feature. Help welcome by existing contributors.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions