renovate/lib/modules/manager/tekton/extract.spec.ts
Luiz Carvalho 1c1042d8e6
feat(manager/tekton): support step images (#20325)
Signed-off-by: Luiz Carvalho <lucarval@redhat.com>
2023-02-13 16:46:11 +01:00

35 lines
910 B
TypeScript

import { Fixtures } from '../../../../test/fixtures';
import { extractPackageFile } from '.';
describe('modules/manager/tekton/extract', () => {
describe('extractPackageFile()', () => {
it('extracts deps from a file', () => {
const result = extractPackageFile(
Fixtures.get('multi-doc.yaml'),
'test-file.yaml'
);
expect(result).toMatchSnapshot();
expect(result?.deps).toHaveLength(39);
});
it('ignores file without any deps', () => {
expect(extractPackageFile('foo: bar', 'test-file.yaml')).toBeNull();
});
it('ignores invalid YAML', () => {
expect(
extractPackageFile(
`
---
bundle: registry.com/repo
`,
'test-file.yaml'
)
).toBeNull();
});
it('ignores empty file', () => {
expect(extractPackageFile('', 'test-file.yaml')).toBeNull();
});
});
});