renovate/lib/manager/droneci/extract.spec.ts
2020-11-12 21:46:08 +01:00

23 lines
620 B
TypeScript

import { readFileSync } from 'fs';
import { resolve } from 'upath';
import { extractPackageFile } from './extract';
const droneYAML = readFileSync(
resolve('lib/manager/droneci/__fixtures__/.drone.yml'),
'utf8'
);
describe('lib/manager/droneci/extract', () => {
describe('extractPackageFile()', () => {
it('returns null for empty', () => {
expect(extractPackageFile('nothing here')).toBeNull();
});
it('extracts multiple image lines', () => {
const res = extractPackageFile(droneYAML);
expect(res.deps).toMatchSnapshot();
expect(res.deps).toHaveLength(4);
});
});
});