Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MicroBadger] Fix tests - new attempt #1677

Merged
merged 1 commit into from
May 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions services/microbadger/microbadger.tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ const t = new ServiceTester({ id: 'microbadger', title: 'MicroBadger' });
module.exports = t;

t.create('image size without a specified tag')
.get('/image-size/fedora/apache.json')
.get('/image-size/wikiwi/docker-build.json')
.expectJSONTypes(Joi.object().keys({
name: 'image size',
value: isFileSize
}));

t.create('image size without a specified tag and no download size data returned')
.get('/image-size/puppet/puppetserver.json')
.expectJSON({ name: 'image size', value: 'unknown' });

t.create('image size with a specified tag')
.get('/image-size/_/httpd/alpine.json')
.get('/image-size/kelseyhightower/helloworld/appengine.json')
.expectJSONTypes(Joi.object().keys({
name: 'image size',
value: isFileSize
Expand Down Expand Up @@ -80,3 +76,11 @@ t.create('unexpected response')
.reply(invalidJSON)
)
.expectJSON({ name: 'image size', value: 'error' });

t.create('missing download size')
.get('/image-size/puppet/puppetserver.json')
.intercept(nock => nock('https://api.microbadger.com')
.get('/v1/images/puppet/puppetserver')
.reply(200, {})
)
.expectJSON({ name: 'image size', value: 'unknown' });