Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
});
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);
});
beforeEach(() => {
Octokit.mockClear();
search.issues.mockClear();
});
beforeEach(() => {
Octokit.mockClear();
search.issues.mockClear();
createShopifyCustomer.mockReturnValueOnce(true);
});