Files
renovate/lib/modules/manager/helmv3/update.spec.ts
Sergei Zharinov 930cf6633c refactor: Rewrite imports with .ts extensions (#40700)
fix: Additional vi.mock path corrections and prettier formatting
2026-01-26 22:48:17 +00:00

51 lines
1.2 KiB
TypeScript

import { dump } from '../../../util/yaml.ts';
import * as helmv3Updater from './index.ts';
describe('modules/manager/helmv3/update', () => {
describe('.bumpPackageVersion()', () => {
const content = dump({
apiVersion: 'v2',
name: 'test',
version: '0.0.2',
});
it('increments', () => {
const { bumpedContent } = helmv3Updater.bumpPackageVersion(
content,
'0.0.2',
'patch',
);
const expected = content.replace('0.0.2', '0.0.3');
expect(bumpedContent).toEqual(expected);
});
it('no ops', () => {
const { bumpedContent } = helmv3Updater.bumpPackageVersion(
content,
'0.0.1',
'patch',
);
expect(bumpedContent).toEqual(content);
});
it('updates', () => {
const { bumpedContent } = helmv3Updater.bumpPackageVersion(
content,
'0.0.1',
'minor',
);
const expected = content.replace('0.0.2', '0.1.0');
expect(bumpedContent).toEqual(expected);
});
it('returns content if bumping errors', () => {
const { bumpedContent } = helmv3Updater.bumpPackageVersion(
content,
'0.0.2',
true as any,
);
expect(bumpedContent).toEqual(content);
});
});
});