renovate/lib/modules/manager/terragrunt/extract.spec.ts
Michael Kriese b4319928f1
refactor: strict manager tests (#16155)
* refactor: strict manager tests

* chore: revert changes

* Update lib/modules/manager/gradle/extract.spec.ts
2022-06-20 17:05:39 +02:00

26 lines
769 B
TypeScript

import { Fixtures } from '../../../../test/fixtures';
import { extractPackageFile } from '.';
describe('modules/manager/terragrunt/extract', () => {
describe('extractPackageFile()', () => {
it('returns null for empty', () => {
expect(extractPackageFile('nothing here')).toBeNull();
});
it('extracts terragrunt sources', () => {
const res = extractPackageFile(Fixtures?.get('2.hcl'));
expect(res).toMatchSnapshot();
expect(res?.deps).toHaveLength(30);
expect(res?.deps.filter((dep) => dep.skipReason)).toHaveLength(5);
});
it('returns null if only local terragrunt deps', () => {
expect(
extractPackageFile(`terragrunt {
source = "../fe"
}
`)
).toBeNull();
});
});
});