Sha256: e9ca305d405824f8bcc704d8d78a6d2a4a8678f7bd2c2e896d06940891e56e73

Contents?: true

Size: 1.28 KB

Versions: 5

Compression:

Stored size: 1.28 KB

Contents

var test = require('tap').test
var path = require('path')
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')
var common = require('../common-tap.js')
var mr = require('npm-registry-mock')
var server

var testdir = path.join(__dirname, path.basename(__filename, '.js'))

function setup () {
  cleanup()
  mkdirp.sync(testdir)
}

function cleanup () {
  rimraf.sync(testdir)
}

test('setup', function (t) {
  setup()
  mr({port: common.port, throwOnUnmatched: true}, function (err, s) {
    t.ifError(err, 'registry mocked successfully')
    server = s
    t.end()
  })
})

test('scoped package names not mangled on error with non-root registry', function (t) {
  server.get('/@scope%2ffoo').reply(404, {})
  common.npm(
    [
      '--registry=' + common.registry,
      '--cache=' + testdir,
      'cache',
      'add',
      '@scope/foo@*',
      '--force'
    ],
    {},
    function (er, code, stdout, stderr) {
      t.ifError(er, 'correctly handled 404')
      t.equal(code, 1, 'exited with error')
      t.match(stderr, /E404/, 'should notify the sort of error as a 404')
      t.match(stderr, /@scope\/foo/, 'should have package name in error')
      server.done()
      t.end()
    }
  )
})

test('cleanup', function (t) {
  server.close()
  cleanup()
  t.pass('cleaned up')
  t.end()
})

Version data entries

5 entries across 4 versions & 1 rubygems

Version Path
node-compiler-0.9.1 vendor/node/deps/npm/test/tap/404-private-registry-scoped.js
node-compiler-0.9.0 vendor/node-v7.2.1/deps/npm/test/tap/404-private-registry-scoped.js
node-compiler-0.8.0 vendor/node-v7.2.0/deps/npm/test/tap/404-private-registry-scoped.js
node-compiler-0.7.0 vendor/node-v6.9.1/deps/npm/test/tap/404-private-registry-scoped.js
node-compiler-0.7.0 vendor/node-v7.1.0/deps/npm/test/tap/404-private-registry-scoped.js