Skip to content

Commit

Permalink
Merge branch 'master' into deprecate-docker-build
Browse files Browse the repository at this point in the history
  • Loading branch information
repo-ranger[bot] authored May 23, 2021
2 parents d32e8f7 + 9aa95d6 commit 804249f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/david/david.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ module.exports = class David extends BaseJsonService {
options: { qs: { path } },
errorMessages: {
/* note:
david returns a 500 response for 'not found'
david returns a 504 response for 'not found'
e.g: https://david-dm.org/foo/barbaz/info.json
not a 404 so we can't handle 'not found' cleanly
because this might also be some other error.
*/
500: 'repo or path not found or david internal error',
504: 'repo or path not found or david internal error',
},
})
}
Expand Down
8 changes: 8 additions & 0 deletions services/david/david.tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,52 +11,60 @@ const isDependencyStatus = Joi.string().valid(

t.create('david dependencies (valid)')
.get('/expressjs/express.json')
.timeout(15000)
.expectBadge({
label: 'dependencies',
message: isDependencyStatus,
})

t.create('david dev dependencies (valid)')
.get('/dev/expressjs/express.json')
.timeout(15000)
.expectBadge({
label: 'dev dependencies',
message: isDependencyStatus,
})

t.create('david optional dependencies (valid)')
.get('/optional/elnounch/byebye.json')
.timeout(15000)
.expectBadge({
label: 'optional dependencies',
message: isDependencyStatus,
})

t.create('david peer dependencies (valid)')
.get('/peer/webcomponents/generator-element.json')
.timeout(15000)
.expectBadge({
label: 'peer dependencies',
message: isDependencyStatus,
})

t.create('david dependencies with path (valid)')
.get('/babel/babel.json?path=packages/babel-core')
.timeout(15000)
.expectBadge({
label: 'dependencies',
message: isDependencyStatus,
})

t.create('david dependencies (none)')
.get('/peer/expressjs/express.json') // express does not specify peer dependencies
.timeout(15000)
.expectBadge({ label: 'peer dependencies', message: 'none' })

t.create('david dependencies (repo not found)')
.get('/pyvesb/emptyrepo.json')
.timeout(15000)
.expectBadge({
label: 'dependencies',
message: 'repo or path not found or david internal error',
})

t.create('david dependencies (path not found')
.get('/babel/babel.json?path=invalid/path')
.timeout(15000)
.expectBadge({
label: 'dependencies',
message: 'repo or path not found or david internal error',
Expand Down

0 comments on commit 804249f

Please sign in to comment.