]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/config-override.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / npm-registry-client / test / config-override.js
1 var test = require('tap').test
2
3 require('./lib/server.js').close()
4 var common = require('./lib/common.js')
5 var config = {
6   proxy: {
7     http: 'http://proxy.npm:8088/',
8     https: 'https://proxy.npm:8043/',
9     localAddress: 'localhost.localdomain'
10   },
11   ssl: {
12     ca: 'not including a PEM',
13     certificate: 'still not including a PEM',
14     key: 'nope',
15     strict: false
16   },
17   retry: {
18     count: 1,
19     factor: 9001,
20     minTimeout: -1,
21     maxTimeout: Infinity
22   },
23   userAgent: 'npm-awesome/4 (Mozilla 5.0)',
24   log: { fake: function () {} },
25   defaultTag: 'next',
26   couchToken: { object: true },
27   sessionToken: 'hamchunx'
28 }
29
30 test('config defaults', function (t) {
31   var client = common.freshClient(config)
32
33   var proxy = client.config.proxy
34   t.equal(proxy.http, 'http://proxy.npm:8088/')
35   t.equal(proxy.https, 'https://proxy.npm:8043/')
36   t.equal(proxy.localAddress, 'localhost.localdomain')
37
38   var ssl = client.config.ssl
39   t.equal(ssl.ca, 'not including a PEM')
40   t.equal(ssl.certificate, 'still not including a PEM')
41   t.equal(ssl.key, 'nope')
42   t.equal(ssl.strict, false)
43
44   var retry = client.config.retry
45   t.equal(retry.count, 1)
46   t.equal(retry.factor, 9001)
47   t.equal(retry.minTimeout, -1)
48   t.equal(retry.maxTimeout, Infinity)
49
50   t.equal(client.config.userAgent, 'npm-awesome/4 (Mozilla 5.0)')
51   t.ok(client.log.fake)
52   t.equal(client.config.defaultTag, 'next')
53   t.ok(client.config.couchToken.object)
54   t.equal(client.config.sessionToken, 'hamchunx')
55
56   t.end()
57 })