Files
Adam Setch 53bd79641c feat(bitbucket-pipelines): update file patterns to support shared configs (#41704)
* feat(bitbucket-pipelines):update file patterns to support shared configs

Signed-off-by: Adam Setch <adam.setch@outlook.com>

* feat(bitbucket-pipelines):update file patterns to support shared configs

Signed-off-by: Adam Setch <adam.setch@outlook.com>

* feat(bitbucket-pipelines):update file patterns to support shared configs

Signed-off-by: Adam Setch <adam.setch@outlook.com>

---------

Signed-off-by: Adam Setch <adam.setch@outlook.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-04-14 14:26:46 +00:00

148 lines
4.0 KiB
TypeScript

import { Fixtures } from '~test/fixtures.ts';
import { extractPackageFile } from './index.ts';
describe('modules/manager/bitbucket-pipelines/extract', () => {
describe('extractPackageFile()', () => {
it('returns null for empty', () => {
expect(
extractPackageFile('nothing here', 'bitbucket-pipelines.yml', {}),
).toBeNull();
});
it('returns null for malformed', () => {
expect(
extractPackageFile(
'image:\n username: ccc',
'bitbucket-pipelines.yml',
{},
),
).toBeNull();
});
it('extracts dependencies', () => {
const res = extractPackageFile(
Fixtures.get('bitbucket-pipelines.yml'),
'bitbucket-pipelines.yml',
{},
);
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',
},
],
});
});
it('extracts dependencies with registryAlias', () => {
const res = extractPackageFile(
Fixtures.get('bitbucket-pipelines.yml'),
'bitbucket-pipelines.yml',
{
registryAliases: {
jfrogecosystem: 'some.jfrog.mirror',
},
},
);
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',
packageName: 'some.jfrog.mirror/jfrog-setup-cli',
depType: 'docker',
},
{
currentValue: '0.2.1',
datasource: 'bitbucket-tags',
depName: 'atlassian/aws-s3-deploy',
depType: 'bitbucket-tags',
},
],
});
});
});
});