Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
repo: 'fork0',
state: 'open',
head: 'upstreamuser:master',
}).resolves([]);
// Make the pull request
ghMock.expects('pullRequestsCreate').withArgs({
owner: 'forkuser', repo: 'fork0',
title: 'Update from upstream repo upstreamuser/repo',
head: 'upstreamuser:master',
base: 'master',
body: generateUpdateBody('upstreamuser/repo'),
maintainer_can_modify: false,
}).rejects(new Error('Explosion in the starboard engine room!'));
ghOriginal.constructor = () => gh
// inject the above mock
let {default: webhook} = proxyquire("controllers/webhookOld", {'../github': ghOriginal});
let req = {
body: {
repository: {
full_name: 'forkuser/fork0',
owner: {
login: 'forkuser',
},
name: 'fork0',
fork: true,
},
},
query: {},