Skip to content

Commit

Permalink
[test] modify tests to behave with our new default expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrugzz committed Nov 8, 2014
1 parent 6df6a70 commit ec31268
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 21 deletions.
8 changes: 5 additions & 3 deletions test/fixtures/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,14 @@ exports.list = {
, '/-/needbuild'
, '/-/prebuilt'
, '/-/nonlocal'
, '/-/by-user/user_blah'
, '/-/starred-by-user/user_blah'
, '/-/starred-by-package/user_blah'
, '/-/_view/all'
, '/-/_list/all'
, '/-/_show/all'
],
users: [
'/-/by-user/user_blah'
, '/-/starred-by-user/user_blah'
, '/-/starred-by-package/user_blah'
, '/-/users'
, '/-/user/user_blah'
, '/_users/user_blah'
Expand Down
16 changes: 16 additions & 0 deletions test/fixtures/private.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ function handle(req, res) {
case '/wl-ok-put-priv':
case '/_session':
case '/priv-basic-ok/0.0.1':
case '/-/jsonp/jsonp_blah':
case '/-/all/since':
case '/-/rss':
case '/-/rss/package_blah':
case '/-/all':
case '/-/all/-/jsonp/jsonp_blah':
case '/-/short':
case '/-/scripts':
case '/-/by-field':
case '/-/fields':
case '/-/needbuild':
case '/-/prebuilt':
case '/-/nonlocal':
case '/-/_view/all':
case '/-/_list/all':
case '/-/_show/all':
pkgOk(req, res)
break
case '/priv-basic-error':
Expand Down
16 changes: 0 additions & 16 deletions test/fixtures/public.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,9 @@ function handle(req, res) {
case '/wl-ok-put':
case '/':
case '/favicon.ico':
case '/-/jsonp/jsonp_blah':
case '/-/all/since':
case '/-/rss':
case '/-/rss/package_blah':
case '/-/all':
case '/-/all/-/jsonp/jsonp_blah':
case '/-/short':
case '/-/scripts':
case '/-/by-field':
case '/-/fields':
case '/-/needbuild':
case '/-/prebuilt':
case '/-/nonlocal':
case '/-/by-user/user_blah':
case '/-/starred-by-user/user_blah':
case '/-/starred-by-package/user_blah':
case '/-/_view/all':
case '/-/_list/all':
case '/-/_show/all':
case '/-/users':
case '/-/user/user_blah':
case '/_users/user_blah':
Expand Down
14 changes: 12 additions & 2 deletions test/smart-private-npm-basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,22 @@ describe('smart-private-npm basic', function() {
describe('list functions', function() {
describe('GET', function() {
var paths = common.list.get
, users = common.list.users;
paths.forEach(function(p) {
it('should proxy to public registry', function(done) {
it(p + ' should proxy to private registry', function(done) {
var opts = {
uri: common.host + p,
json: true
}
request.get(opts, common.privateOk(done))
})
})
users.forEach(function (u) {
it(u + ' should proxy to public registry', function(done) {
var opts = {
uri: common.host + u,
json: true
}
request.get(opts, common.publicOk(done))
})
})
Expand All @@ -108,7 +118,7 @@ describe('smart-private-npm basic', function() {
describe('PUT', function() {
var paths = common.list.put
paths.forEach(function(p) {
it('should proxy to public registry', function(done) {
it(p + ' should proxy to public registry', function(done) {
var opts = {
uri: common.host + p,
json: true,
Expand Down

0 comments on commit ec31268

Please sign in to comment.