Skip to content
Snippets Groups Projects
Unverified Commit 977a0271 authored by Max Rose's avatar Max Rose Committed by GitHub
Browse files

fix(presets): log depreciation only if fallback found (#14281)

parent 9c160821
Branches
Tags
No related merge requests found
......@@ -15,15 +15,23 @@ describe('config/presets/util', () => {
fetch.mockReset();
});
it('works', async () => {
fetch.mockResolvedValue({ sub: { preset: { foo: true } } });
fetch.mockResolvedValueOnce({ sub: { preset: { foo: true } } });
expect(await fetchPreset({ ...config, fetch })).toEqual({
sub: { preset: { foo: true } },
});
fetch.mockRejectedValueOnce(new Error(PRESET_DEP_NOT_FOUND));
fetch.mockResolvedValueOnce({ sub: { preset: { foo: true } } });
expect(await fetchPreset({ ...config, fetch })).toEqual({
sub: { preset: { foo: true } },
});
fetch.mockResolvedValueOnce({ sub: { preset: { foo: true } } });
expect(
await fetchPreset({ ...config, filePreset: 'some/sub', fetch })
).toEqual({ preset: { foo: true } });
fetch.mockResolvedValueOnce({ sub: { preset: { foo: true } } });
expect(
await fetchPreset({ ...config, filePreset: 'some/sub/preset', fetch })
).toEqual({ foo: true });
......
......@@ -35,15 +35,15 @@ export async function fetchPreset({
if (err.message !== PRESET_DEP_NOT_FOUND) {
throw err;
}
logger.info(
'Fallback to renovate.json file as a preset is deprecated, please use a default.json file instead.'
);
jsonContent = await fetch(
pkgName,
buildFilePath('renovate.json'),
endpoint,
packageTag
);
logger.info(
'Fallback to renovate.json file as a preset is deprecated, please use a default.json file instead.'
);
}
} else {
jsonContent = await fetch(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment