mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-14 16:46:25 +00:00
26 lines
805 B
TypeScript
26 lines
805 B
TypeScript
|
import { readFileSync } from 'fs';
|
||
|
import { extractPackageFile } from './extract';
|
||
|
|
||
|
const tg1 = readFileSync('lib/manager/terragrunt/__fixtures__/2.hcl', 'utf8');
|
||
|
const tg2 = `terragrunt {
|
||
|
source = "../../modules/fe"
|
||
|
}
|
||
|
`;
|
||
|
|
||
|
describe('lib/manager/terragrunt/extract', () => {
|
||
|
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();
|
||
|
});
|
||
|
});
|
||
|
});
|