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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
c2f18e47
Commit
c2f18e47
authored
6 years ago
by
Rhys Arkins
Browse files
Options
Downloads
Patches
Plain Diff
fix(ruby): datasource throw if empty
parent
1408bb4b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/datasource/ruby-version/index.js
+1
-1
1 addition, 1 deletion
lib/datasource/ruby-version/index.js
test/datasource/ruby-version.spec.js
+8
-2
8 additions, 2 deletions
test/datasource/ruby-version.spec.js
with
9 additions
and
3 deletions
lib/datasource/ruby-version/index.js
+
1
−
1
View file @
c2f18e47
...
@@ -39,6 +39,6 @@ async function getPkgReleases() {
...
@@ -39,6 +39,6 @@ async function getPkgReleases() {
throw
new
Error
(
'
registry-failure
'
);
throw
new
Error
(
'
registry-failure
'
);
}
}
logger
.
warn
({
err
},
'
Ruby release lookup failure: Unknown error
'
);
logger
.
warn
({
err
},
'
Ruby release lookup failure: Unknown error
'
);
return
null
;
throw
new
Error
(
'
registry-failure
'
)
;
}
}
}
}
This diff is collapsed.
Click to expand it.
test/datasource/ruby-version.spec.js
+
8
−
2
View file @
c2f18e47
...
@@ -18,9 +18,15 @@ describe('datasource/gradle', () => {
...
@@ -18,9 +18,15 @@ describe('datasource/gradle', () => {
const
res
=
await
getPkgReleases
();
const
res
=
await
getPkgReleases
();
expect
(
res
).
toMatchSnapshot
();
expect
(
res
).
toMatchSnapshot
();
});
});
it
(
'
returns null
for empty result
'
,
async
()
=>
{
it
(
'
throws
for empty result
'
,
async
()
=>
{
got
.
mockReturnValueOnce
({
body
:
{}
});
got
.
mockReturnValueOnce
({
body
:
{}
});
expect
(
await
getPkgReleases
()).
toBeNull
();
let
e
;
try
{
await
getPkgReleases
();
}
catch
(
err
)
{
e
=
err
;
}
expect
(
e
).
toBeDefined
();
});
});
it
(
'
throws for 404
'
,
async
()
=>
{
it
(
'
throws for 404
'
,
async
()
=>
{
...
...
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