mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-15 17:16:25 +00:00
b255275632
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
25 lines
783 B
TypeScript
25 lines
783 B
TypeScript
import { getName, loadFixture } from '../../../test/util';
|
|
import { extractPackageFile } from './extract';
|
|
|
|
const tg1 = loadFixture(__filename, '2.hcl');
|
|
const tg2 = `terragrunt {
|
|
source = "../../modules/fe"
|
|
}
|
|
`;
|
|
|
|
describe(getName(__filename), () => {
|
|
describe('extractPackageFile()', () => {
|
|
it('returns null for empty', () => {
|
|
expect(extractPackageFile('nothing here')).toBeNull();
|
|
});
|
|
it('extracts terragrunt sources', () => {
|
|
const res = extractPackageFile(tg1);
|
|
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(tg2)).toBeNull();
|
|
});
|
|
});
|
|
});
|