How to use the octonode.client.mockReturnValue function in octonode

To help you get started, we’ve selected a few octonode examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 20minutes / serverless-github-check / tests / label.spec.js View on Github external
test('got a blocking label in multiple labels', async () => {
    client.mockReturnValue({
      repo: jest.fn((params) => {
        expect(params).toBe('foo/bar')

        return {
          statusAsync: jest.fn((commit, payload) => {
            expect(commit).toBe('ee55a1223ce20c3e7cb776349cb7f8efb7b88511')
            expect(payload.state).toBe('failure')
            expect(payload.context).toBe('20 Minutes - Label validation')
            expect(payload.description).toBeDefined()
          }),
        }
      }),
    })
    const callback = jest.fn()
    const githubEvent = {
      pull_request: {
github 20minutes / serverless-github-check / tests / specification.spec.js View on Github external
test('body and title are OK', async () => {
    client.mockReturnValue({
      repo: jest.fn((params) => {
        expect(params).toBe('foo/bar')

        return {
          statusAsync: jest.fn((commit, payload) => {
            expect(commit).toBe('ee55a1223ce20c3e7cb776349cb7f8efb7b88511')
            expect(payload.state).toBe('success')
            expect(payload.context).toBe('20 Minutes - PR Specification')
            expect(payload.description).toBeDefined()
          }),
        }
      }),
    })
    const callback = jest.fn()
    const githubEvent = {
      pull_request: {

octonode

nodejs wrapper for github v3 api

MIT
Latest version published 4 years ago

Package Health Score

47 / 100
Full package analysis