0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 21:48:32 +00:00
renovatebot_renovate/lib/modules/manager/scalafmt/extract.spec.ts
Gaël Jourdan-Weil 1119d609fd
feat(manager/scalafmt): implement manager (#28192)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
2024-04-01 13:02:27 +00:00

39 lines
1.1 KiB
TypeScript

import { codeBlock } from 'common-tags';
import { extractPackageFile } from './extract';
describe('modules/manager/scalafmt/extract', () => {
describe('extractPackageFile()', () => {
it('extracts version correctly', () => {
const scalafmtConf = codeBlock`
version = 3.8.0
`;
const packages = extractPackageFile(scalafmtConf);
expect(packages).toMatchObject({
deps: [
{
datasource: 'github-releases',
packageName: 'scalameta/scalafmt',
depName: 'scalafmt',
currentValue: '3.8.0',
versioning: 'semver',
extractVersion: '^v(?<version>\\S+)',
},
],
});
});
it('ignore file if no version specified', () => {
const scalafmtConf = codeBlock`
maxColumn = 80
`;
const packages = extractPackageFile(scalafmtConf);
expect(packages).toBeNull();
});
it('should return empty packagefiles is no content is provided', () => {
const packages = extractPackageFile('');
expect(packages).toBeNull();
});
});
});