mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-03-25 02:32:52 -05:00
parent
4ea84e8b74
commit
7967d5857d
6 changed files with 10 additions and 19 deletions
|
@ -133,7 +133,7 @@ module.exports.log_and_etagify = function(req, res, next) {
|
|||
|
||||
if (typeof(body) === 'object' && body != null) {
|
||||
if (body.error) {
|
||||
res._sinopia_error = body.reason || body.error
|
||||
res._sinopia_error = body.error
|
||||
}
|
||||
body = JSON.stringify(body, undefined, '\t') + '\n'
|
||||
}
|
||||
|
|
|
@ -10,8 +10,7 @@ module.exports = function() {
|
|||
it('add tag - 404', function(cb) {
|
||||
server.add_tag('testpkg-tag', 'tagtagtag', '0.0.1', function(res, body) {
|
||||
assert.equal(res.statusCode, 404)
|
||||
assert.equal(body.error, 'not_found')
|
||||
assert(~body.reason.indexOf('no such package'))
|
||||
assert(~body.error.indexOf('no such package'))
|
||||
cb()
|
||||
})
|
||||
})
|
||||
|
@ -35,8 +34,7 @@ module.exports = function() {
|
|||
it('add tag - bad ver', function(cb) {
|
||||
server.add_tag('testpkg-tag', 'tagtagtag', '0.0.1-x', function(res, body) {
|
||||
assert.equal(res.statusCode, 404)
|
||||
assert.equal(body.error, 'not_found')
|
||||
assert(~body.reason.indexOf('version doesn\'t exist'))
|
||||
assert(~body.error.indexOf('version doesn\'t exist'))
|
||||
cb()
|
||||
})
|
||||
})
|
||||
|
|
|
@ -15,8 +15,7 @@ module.exports = function() {
|
|||
it('trying to fetch non-existent package', function(cb) {
|
||||
server.get_package('testpkg', function(res, body) {
|
||||
assert.equal(res.statusCode, 404)
|
||||
assert.equal(body.error, 'not_found')
|
||||
assert(~body.reason.indexOf('no such package'))
|
||||
assert(~body.error.indexOf('no such package'))
|
||||
cb()
|
||||
})
|
||||
})
|
||||
|
@ -29,8 +28,7 @@ module.exports = function() {
|
|||
it('downloading non-existent tarball', function(cb) {
|
||||
server.get_tarball('testpkg', 'blahblah', function(res, body) {
|
||||
assert.equal(res.statusCode, 404)
|
||||
assert.equal(body.error, 'not_found')
|
||||
assert(~body.reason.indexOf('no such file'))
|
||||
assert(~body.error.indexOf('no such file'))
|
||||
cb()
|
||||
})
|
||||
})
|
||||
|
@ -111,8 +109,7 @@ module.exports = function() {
|
|||
it('uploading new package version for bad pkg', function(cb) {
|
||||
server.put_version('testpxg', '0.0.1', require('./lib/package')('testpxg'), function(res, body) {
|
||||
assert.equal(res.statusCode, 404)
|
||||
assert.equal(body.error, 'not_found')
|
||||
assert(~body.reason.indexOf('no such package'))
|
||||
assert(~body.error.indexOf('no such package'))
|
||||
cb()
|
||||
})
|
||||
})
|
||||
|
|
|
@ -13,8 +13,7 @@ module.exports = function() {
|
|||
it('downloading non-existent tarball #1 / srv2', function(cb) {
|
||||
server2.get_tarball('testpkg-gh29', 'blahblah', function(res, body) {
|
||||
assert.equal(res.statusCode, 404)
|
||||
assert.equal(body.error, 'not_found')
|
||||
assert(~body.reason.indexOf('no such package'))
|
||||
assert(~body.error.indexOf('no such package'))
|
||||
cb()
|
||||
})
|
||||
})
|
||||
|
@ -33,8 +32,7 @@ module.exports = function() {
|
|||
it('downloading non-existent tarball #2 / srv2', function(cb) {
|
||||
server2.get_tarball('testpkg-gh29', 'blahblah', function(res, body) {
|
||||
assert.equal(res.statusCode, 404)
|
||||
assert.equal(body.error, 'not_found')
|
||||
assert(~body.reason.indexOf('no such file'))
|
||||
assert(~body.error.indexOf('no such file'))
|
||||
cb()
|
||||
})
|
||||
})
|
||||
|
|
|
@ -12,8 +12,7 @@ module.exports = function() {
|
|||
it('testing anti-loop', function(cb) {
|
||||
server2.get_package('testloop', function(res, body) {
|
||||
assert.equal(res.statusCode, 404)
|
||||
assert.equal(body.error, 'not_found')
|
||||
assert(~body.reason.indexOf('no such package'))
|
||||
assert(~body.error.indexOf('no such package'))
|
||||
cb()
|
||||
})
|
||||
})
|
||||
|
|
|
@ -13,8 +13,7 @@ module.exports = function() {
|
|||
server.get_package('testexp_tags', function(res, body) {
|
||||
// shouldn't exist yet
|
||||
assert.equal(res.statusCode, 404)
|
||||
assert.equal(body.error, 'not_found')
|
||||
assert(~body.reason.indexOf('no such package'))
|
||||
assert(~body.error.indexOf('no such package'))
|
||||
cb()
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue