Skip to content

Commit

Permalink
[npm] add service-tests for custom registry support
Browse files Browse the repository at this point in the history
  • Loading branch information
iamstarkov committed Nov 19, 2017
1 parent c16c007 commit 6c71b35
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions service-tests/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ t.create("gets the tagged release's node version version of ionic")
.expectJSONTypes(Joi.object({ name: 'node@next' }).unknown())
.afterJSON(json => { assertIsSemverRange(json.value); });

t.create('gets the node version of passport from a custom registry')
.get('/v/passport.json?registry_uri=https://registry.npm.taobao.org')
.expectJSONTypes(Joi.object({ name: 'node' }).unknown())
.afterJSON(json => { assertIsSemverRange(json.value); });

t.create("gets the tagged release's node version of @cycle/core")
.get('/v/@cycle/core/canary.json')
.expectJSONTypes(Joi.object({ name: 'node@canary' }).unknown())
Expand Down
8 changes: 8 additions & 0 deletions service-tests/npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@ t.create('gets the tagged package version of npm')
.get('/v/npm/next.json')
.expectJSONTypes(Joi.object().keys({ name: 'npm@next', value: isSemver }));

t.create('gets the package version of left-pad from a custom registry')
.get('/v/left-pad.json?registry_uri=https://registry.npm.taobao.org')
.expectJSONTypes(Joi.object().keys({ name: 'npm', value: isSemver }));

t.create('gets the tagged package version of @cycle/core')
.get('/v/@cycle/core/canary.json')
.expectJSONTypes(Joi.object().keys({ name: 'npm@canary', value: isSemver }));

t.create('gets the tagged package version of @cycle/core from a custom registry')
.get('/v/@cycle/core/canary.json?registry_uri=https://registry.npm.taobao.org')
.expectJSONTypes(Joi.object().keys({ name: 'npm@canary', value: isSemver }));

t.create('invalid package name')
.get('/v/frodo-is-not-a-package.json')
.expectJSON({ name: 'npm', value: 'invalid' });

0 comments on commit 6c71b35

Please sign in to comment.