]> 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-defaults.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-defaults.js
1 var test = require('tap').test
2
3 require('./lib/server.js').close()
4 var common = require('./lib/common.js')
5
6 test('config defaults', function (t) {
7   var client = common.freshClient()
8
9   var proxy = client.config.proxy
10   t.notOk(proxy.http, 'no default value for HTTP proxy')
11   t.notOk(proxy.https, 'no default value for HTTPS proxy')
12   t.notOk(proxy.localAddress, 'no default value for local address')
13
14   var ssl = client.config.ssl
15   t.notOk(ssl.ca, 'no default value for SSL certificate authority bundle')
16   t.notOk(ssl.certificate, 'no default value for SSL client certificate')
17   t.notOk(ssl.key, 'no default value for SSL client certificate key')
18   t.equal(ssl.strict, true, 'SSL is strict by default')
19
20   var retry = client.config.retry
21   t.equal(retry.retries, 2, 'default retry count is 2')
22   t.equal(retry.factor, 10, 'default retry factor is 10')
23   t.equal(retry.minTimeout, 10000, 'retry minimum timeout is 10000 (10 seconds)')
24   t.equal(retry.maxTimeout, 60000, 'retry maximum timeout is 60000 (60 seconds)')
25
26   t.equal(client.config.userAgent, 'node/' + process.version, 'default userAgent')
27   t.ok(client.log.info, "there's a default logger")
28   t.equal(client.config.defaultTag, 'latest', 'default tag is "latest"')
29   t.notOk(client.config.couchToken, 'no couchToken by default')
30   t.notOk(client.config.sessionToken, 'no sessionToken by default')
31
32   t.end()
33 })
34
35 test('missing HTTPS proxy defaults to HTTP proxy', function (t) {
36   var client = common.freshClient({ proxy: { http: 'http://proxy.npm:8088/' } })
37
38   t.equal(client.config.proxy.http, 'http://proxy.npm:8088/', 'HTTP proxy set')
39   t.equal(client.config.proxy.http, client.config.proxy.https, 'HTTP === HTTPS')
40
41   t.end()
42 })