2019-07-31 17:23:18 +00:00
|
|
|
import { readFileSync } from 'fs';
|
|
|
|
import { resolve } from 'path';
|
|
|
|
|
2020-02-05 00:14:31 +00:00
|
|
|
import { extractPackageFile } from './extract';
|
2019-07-31 17:23:18 +00:00
|
|
|
|
|
|
|
const droneYAML = readFileSync(
|
2020-02-05 00:14:31 +00:00
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|