Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('does not return error if current branch is correct', () => {
getCurrentBranch.mockImplementation(() => 'master');
const result = validate(defaultOpts);
expect(result).toBe(true);
});
it('works', () => {
validateBeforePrepare.mockImplementation(() => true);
const version = '1.2.3';
const branch = 'legacy';
getCurrentVersion.mockImplementation(() => version);
getCurrentBranch.mockImplementation(() => branch);
const { currentVersion, baseBranch } = validate({
config: {
getTagName: () => 'v1.2.3',
mergeStrategy: {
toSameBranch: ['master'],
toReleaseBranch: {
legacy: 'v1',
},
},
},
});
expect(currentVersion).toEqual(version);
expect(baseBranch).toEqual(branch);
expect(exitProcess).toHaveBeenCalledTimes(0);
});