1 var test = require('tap').test
2 var path = require('path')
3 var common = require('../common-tap.js')
4 var mr = require('npm-registry-mock')
7 var packageName = path.basename(__filename,'.js')
9 test('setup', function (t) {
10 mr({port: common.port, throwOnUnmatched: true}, function (err, s) {
11 t.ifError(err, 'registry mocked successfully')
17 test('package names not mangled on error with non-root registry', function (t) {
25 function (er, code, stdout, stderr) {
26 t.ifError(er, 'correctly handled 404')
27 t.equal(code, 1, 'exited with error')
28 t.match(stderr, packageName, 'should have package name in error')
34 test('cleanup', function (t) {