mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-15 09:06:25 +00:00
b4319928f1
* refactor: strict manager tests * chore: revert changes * Update lib/modules/manager/gradle/extract.spec.ts
51 lines
1.2 KiB
TypeScript
51 lines
1.2 KiB
TypeScript
import * as sbtUpdater from '.';
|
|
|
|
describe('modules/manager/sbt/update', () => {
|
|
describe('.bumpPackageVersion()', () => {
|
|
const content =
|
|
'name := "test"\n' +
|
|
'organization := "test-org"\n' +
|
|
'version := "0.0.2"\n';
|
|
|
|
it('increments', () => {
|
|
const { bumpedContent } = sbtUpdater.bumpPackageVersion(
|
|
content,
|
|
'0.0.2',
|
|
'patch'
|
|
);
|
|
|
|
expect(bumpedContent).toEqual(content.replace('0.0.2', '0.0.3'));
|
|
expect(bumpedContent).not.toEqual(content);
|
|
});
|
|
|
|
it('no ops', () => {
|
|
const { bumpedContent } = sbtUpdater.bumpPackageVersion(
|
|
content,
|
|
'0.0.1',
|
|
'patch'
|
|
);
|
|
|
|
expect(bumpedContent).toEqual(content);
|
|
});
|
|
|
|
it('updates', () => {
|
|
const { bumpedContent } = sbtUpdater.bumpPackageVersion(
|
|
content,
|
|
'0.0.1',
|
|
'minor'
|
|
);
|
|
expect(bumpedContent).toEqual(content.replace('0.0.2', '0.1.0'));
|
|
expect(bumpedContent).not.toEqual(content);
|
|
});
|
|
|
|
it('returns content if bumping errors', () => {
|
|
const { bumpedContent } = sbtUpdater.bumpPackageVersion(
|
|
content,
|
|
'0.0.2',
|
|
true as any
|
|
);
|
|
|
|
expect(bumpedContent).toEqual(content);
|
|
});
|
|
});
|
|
});
|