How to use the @octokit/rest.search.issues function in @octokit/rest

To help you get started, we’ve selected a few @octokit/rest 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 gatsbyjs / api.gatsbyjs.org / src / lib / __tests__ / github.js View on Github external
test('returns true when the user has merged PRs in the org', async () => {
      search.issues.mockReturnValueOnce(mockIssues);

      const val = await isGitHubContributor('jlengstorf');
      expect(val).toBe(true);
    });
github gatsbyjs / api.gatsbyjs.org / routes / __tests__ / store.js View on Github external
test('should return a discount code', done => {
    search.issues.mockReturnValueOnce(mockIssues);

    const res = {
      status: () => ({
        json: json => {
          expect(json.contributor).toBe(true);
          expect(json.customer).toBe(true);
          expect(json.subscribed).toBe(false);
          expect(json.discount_code).toBe(process.env.SHOPIFY_DISCOUNT_CODE);
          done();
        }
      })
    };

    store.handle(defaultRequest, res);
  });
github gatsbyjs / api.gatsbyjs.org / src / lib / __tests__ / github.js View on Github external
beforeEach(() => {
    Octokit.mockClear();
    search.issues.mockClear();
  });
github gatsbyjs / api.gatsbyjs.org / routes / __tests__ / store.js View on Github external
beforeEach(() => {
    Octokit.mockClear();
    search.issues.mockClear();
    createShopifyCustomer.mockReturnValueOnce(true);
  });