-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
common.spec.ts
26 lines (24 loc) · 974 Bytes
/
common.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { load } from 'js-yaml';
import { Fixtures } from '../../../../test/fixtures';
import { findSourceUrl } from './common';
import type { HelmRepository } from './types';
// Truncated index.yaml file
const repo = load(Fixtures.get('sample.yaml'), {
json: true,
}) as HelmRepository;
describe('modules/datasource/helm/common', () => {
describe('findSourceUrl', () => {
test.each`
input | output
${'airflow'} | ${{ sourceUrl: 'https://github.com/bitnami/charts', sourceDirectory: 'bitnami/airflow' }}
${'coredns'} | ${{ sourceUrl: 'https://github.com/coredns/helm', sourceDirectory: undefined }}
${'pgadmin4'} | ${{ sourceUrl: 'https://github.com/rowanruseler/helm-charts', sourceDirectory: undefined }}
${'dummy'} | ${{}}
`(
'$input -> $output',
({ input, output }: { input: string; output: string }) => {
expect(findSourceUrl(repo.entries[input][0])).toEqual(output);
}
);
});
});