Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
config: {
getTagName: () => 'v1.2.3',
releases: { assetsToUpload, extractChangelog },
updateChangelog: false,
},
dir: '.',
dryRun: false,
});
const createRelease = jest.fn().mockImplementation(() => ({
data: {
upload_url: 'https://dummy/upload/url', // eslint-disable-line camelcase
},
}));
const uploadReleaseAsset = jest.fn();
Octokit.mockImplementation(function() {
this.repos = { createRelease, uploadReleaseAsset };
});
describe('createGitHubRelease', () => {
beforeEach(() => {
getRepoInfo.mockImplementation(() => ({
owner: 'my',
name: 'repo',
}));
fs.readFileSync = jest.fn();
fs.statSync = jest.fn().mockImplementation(() => ({ size: 1024 }));
mime.lookup.mockImplementation(() => 'application/zip');
globby.mockImplementation(path => Promise.resolve([path]));
});
it('works without assets', async () => {