mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-14 16:46:25 +00:00
80 lines
2.1 KiB
TypeScript
80 lines
2.1 KiB
TypeScript
import { Fixtures } from '../../../../test/fixtures';
|
|
import { extractPackageFile } from '.';
|
|
|
|
describe('modules/manager/bitbucket-pipelines/extract', () => {
|
|
describe('extractPackageFile()', () => {
|
|
it('returns null for empty', () => {
|
|
expect(
|
|
extractPackageFile('nothing here', 'bitbucket-pipelines.yaml')
|
|
).toBeNull();
|
|
});
|
|
|
|
it('returns null for malformed', () => {
|
|
expect(
|
|
extractPackageFile(
|
|
'image:\n username: ccc',
|
|
'bitbucket-pipelines.yaml'
|
|
)
|
|
).toBeNull();
|
|
});
|
|
|
|
it('extracts dependencies', () => {
|
|
const res = extractPackageFile(
|
|
Fixtures.get('bitbucket-pipelines.yaml'),
|
|
'bitbucket-pipelines.yaml'
|
|
);
|
|
expect(res).toMatchObject({
|
|
deps: [
|
|
{
|
|
currentDigest: undefined,
|
|
currentValue: '10.15.1',
|
|
datasource: 'docker',
|
|
depName: 'node',
|
|
depType: 'docker',
|
|
},
|
|
{
|
|
currentDigest: undefined,
|
|
currentValue: '18.15.0',
|
|
datasource: 'docker',
|
|
depName: 'node',
|
|
depType: 'docker',
|
|
},
|
|
{
|
|
currentDigest: undefined,
|
|
currentValue: '18.15.1',
|
|
datasource: 'docker',
|
|
depName: 'node',
|
|
depType: 'docker',
|
|
},
|
|
{
|
|
currentDigest: undefined,
|
|
currentValue: '18.15.2',
|
|
datasource: 'docker',
|
|
depName: 'node',
|
|
depType: 'docker',
|
|
},
|
|
{
|
|
currentDigest: undefined,
|
|
currentValue: '10.15.2',
|
|
datasource: 'docker',
|
|
depName: 'node',
|
|
depType: 'docker',
|
|
},
|
|
{
|
|
currentDigest: undefined,
|
|
currentValue: '2.0.2',
|
|
datasource: 'docker',
|
|
depName: 'jfrogecosystem/jfrog-setup-cli',
|
|
depType: 'docker',
|
|
},
|
|
{
|
|
currentValue: '0.2.1',
|
|
datasource: 'bitbucket-tags',
|
|
depName: 'atlassian/aws-s3-deploy',
|
|
depType: 'bitbucket-tags',
|
|
},
|
|
],
|
|
});
|
|
});
|
|
});
|
|
});
|