mirror of
https://github.com/renovatebot/renovate.git
synced 2024-12-22 21:48:32 +00:00
1119d609fd
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
39 lines
1.1 KiB
TypeScript
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();
|
|
});
|
|
});
|
|
});
|