Skip to content
Snippets Groups Projects
Commit 450b16b4 authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

fix: downgrade dep not found error to warning (#818)

parent 660a208b
No related merge requests found
......@@ -31,7 +31,7 @@ async function renovateNpmPackage(config) {
} else {
// If dependency lookup fails then warn and return
const result = {
type: 'error',
type: 'warning',
message: 'Failed to look up dependency',
};
if (config.hasYarnLock || config.hasPackageLock) {
......
......@@ -6,22 +6,32 @@ Array [
]
`;
exports[`lib/workers/package/npm renovateNpmPackage returns error if no npm dep found 1`] = `
exports[`lib/workers/package/npm renovateNpmPackage returns error if no npm scoped dep found 1`] = `
Array [
Object {
"message": "Failed to look up dependency. This will block *all* dependencies from being updated due to presence of lock file.",
"repositoryUrl": null,
"type": "error",
"type": "warning",
},
]
`;
exports[`lib/workers/package/npm renovateNpmPackage returns error if no npm scoped dep found 1`] = `
exports[`lib/workers/package/npm renovateNpmPackage returns warning if no npm dep found 1`] = `
Array [
Object {
"message": "Failed to look up dependency",
"repositoryUrl": null,
"type": "warning",
},
]
`;
exports[`lib/workers/package/npm renovateNpmPackage returns warning if no npm dep found and lock file 1`] = `
Array [
Object {
"message": "Failed to look up dependency. This will block *all* dependencies from being updated due to presence of lock file.",
"repositoryUrl": null,
"type": "error",
"type": "warning",
},
]
`;
......
......@@ -11,6 +11,7 @@ describe('lib/workers/package/npm', () => {
describe('renovateNpmPackage', () => {
let config;
beforeEach(() => {
jest.resetAllMocks();
config = {
...defaultConfig,
logger,
......@@ -24,12 +25,19 @@ describe('lib/workers/package/npm', () => {
const res = await npm.renovateNpmPackage(config);
expect(res).toMatchSnapshot();
});
it('returns error if no npm dep found', async () => {
it('returns warning if no npm dep found', async () => {
const res = await npm.renovateNpmPackage(config);
expect(res).toMatchSnapshot();
expect(res).toHaveLength(1);
expect(res[0].type).toEqual('warning');
expect(npmApi.getDependency.mock.calls.length).toBe(1);
});
it('returns warning if no npm dep found and lock file', async () => {
config.hasPackageLock = true;
const res = await npm.renovateNpmPackage(config);
expect(res).toMatchSnapshot();
expect(res).toHaveLength(1);
expect(res[0].type).toEqual('error');
expect(res[0].type).toEqual('warning');
expect(npmApi.getDependency.mock.calls.length).toBe(1);
});
it('returns error if no npm scoped dep found', async () => {
......@@ -38,7 +46,7 @@ describe('lib/workers/package/npm', () => {
const res = await npm.renovateNpmPackage(config);
expect(res).toMatchSnapshot();
expect(res).toHaveLength(1);
expect(res[0].type).toEqual('error');
expect(res[0].type).toEqual('warning');
});
it('returns warning if warning found', async () => {
npmApi.getDependency.mockReturnValueOnce({});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment