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

24 lines
649 B
TypeScript
Raw Normal View History

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