Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
450b16b4
Commit
450b16b4
authored
7 years ago
by
Rhys Arkins
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: downgrade dep not found error to warning (#818)
parent
660a208b
Loading
Loading
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/workers/package/npm.js
+1
-1
1 addition, 1 deletion
lib/workers/package/npm.js
test/workers/package/__snapshots__/npm.spec.js.snap
+14
-4
14 additions, 4 deletions
test/workers/package/__snapshots__/npm.spec.js.snap
test/workers/package/npm.spec.js
+11
-3
11 additions, 3 deletions
test/workers/package/npm.spec.js
with
26 additions
and
8 deletions
lib/workers/package/npm.js
+
1
−
1
View file @
450b16b4
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
test/workers/package/__snapshots__/npm.spec.js.snap
+
14
−
4
View file @
450b16b4
...
...
@@ -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
",
},
]
`;
...
...
This diff is collapsed.
Click to expand it.
test/workers/package/npm.spec.js
+
11
−
3
View file @
450b16b4
...
...
@@ -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
({});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment