mirror of
https://github.com/renovatebot/renovate.git
synced 2024-12-22 21:48:32 +00:00
37 lines
966 B
TypeScript
37 lines
966 B
TypeScript
import type { LookupUpdateConfig } from './types';
|
|
import { determineNewReplacementName } from './utils';
|
|
|
|
const lookupConfig: LookupUpdateConfig = {
|
|
datasource: 'npm',
|
|
packageName: 'b',
|
|
currentValue: '1.0.0',
|
|
versioning: 'semver',
|
|
rangeStrategy: 'replace',
|
|
};
|
|
|
|
describe('workers/repository/process/lookup/utils', () => {
|
|
describe('determineNewReplacementName()', () => {
|
|
it('returns the replacement name if defined', () => {
|
|
expect(
|
|
determineNewReplacementName({
|
|
...lookupConfig,
|
|
replacementName: 'foo',
|
|
}),
|
|
).toBe('foo');
|
|
});
|
|
|
|
it('returns the replacement name template if defined', () => {
|
|
expect(
|
|
determineNewReplacementName({
|
|
...lookupConfig,
|
|
replacementNameTemplate: 'foo',
|
|
}),
|
|
).toBe('foo');
|
|
});
|
|
|
|
it('returns the package name if defined', () => {
|
|
expect(determineNewReplacementName(lookupConfig)).toBe('b');
|
|
});
|
|
});
|
|
});
|