renovate/lib/manager/droneci/extract.spec.ts

24 lines
619 B
TypeScript
Raw Normal View History

2019-07-31 17:23:18 +00:00
import { readFileSync } from 'fs';
import { resolve } from 'path';
import { extractPackageFile } from './extract';
2019-07-31 17:23:18 +00:00
const droneYAML = readFileSync(
resolve('lib/manager/droneci/__fixtures__/.drone.yml'),
2019-07-31 17:23:18 +00:00
'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);
});
});
});