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

Add tests for integration #1039

merged 1 commit into from Aug 13, 2017
Jump to file or symbol
Failed to load files and symbols.
+51 −0
Diff settings


Just for now

Copy path View file
@@ -0,0 +1,51 @@
'use strict';
const Joi = require('joi');
const ServiceTester = require('./runner/service-tester');
const t = new ServiceTester({ id: 'hexpm', title: '' });
module.exports = t;
t.create('downloads per week')
name: Joi.equal('downloads'),
value: Joi.string().regex(/^\d+[a-z]?\/week$/)
t.create('downloads per day')
name: Joi.equal('downloads'),
value: Joi.string().regex(/^\d+[a-z]?\/day$/)
t.create('downloads in total')
name: Joi.equal('downloads'),
value: Joi.string().regex(/^\d+[kMGTPEZY]?$/)
name: Joi.equal('hex'),
value: Joi.string().regex(/^v\d+.\d+.?\d?$/)
name: Joi.equal('license'),
value: Joi.string().required()
t.create('unknown repo')
.expectJSON({ name: 'hex', value: 'invalid' });
t.create('connection error')
.expectJSON({ name: 'hex', value: 'inaccessible' });
ProTip! Use n and p to navigate between commits in a pull request.