]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/404-private-registry-scoped.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / test / tap / 404-private-registry-scoped.js
1 var test = require('tap').test
2 var common = require('../common-tap.js')
3 var mr = require('npm-registry-mock')
4 var server
5
6 test('setup', function (t) {
7   mr({port: common.port, throwOnUnmatched: true}, function (err, s) {
8     t.ifError(err, 'registry mocked successfully')
9     server = s
10     t.end()
11   })
12 })
13
14 test('scoped package names not mangled on error with non-root registry', function (t) {
15   common.npm(
16     [
17       'cache',
18       'add',
19       '@scope/foo@*',
20       '--force'
21     ],
22     {},
23     function (er, code, stdout, stderr) {
24       t.ifError(er, 'correctly handled 404')
25       t.equal(code, 1, 'exited with error')
26       t.match(stderr, /404 Not found/, 'should notify the sort of error as a 404')
27       t.match(stderr, /@scope\/foo/, 'should have package name in error')
28       t.end()
29     }
30   )
31 })
32
33 test('cleanup', function (t) {
34   t.pass('cleaned up')
35   server.done()
36   server.close()
37   t.end()
38 })