]> gerrit.simantics Code Review - simantics/district.git/blobdiff - 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
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/config-override.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/config-override.js
new file mode 100644 (file)
index 0000000..026cb19
--- /dev/null
@@ -0,0 +1,57 @@
+var test = require('tap').test
+
+require('./lib/server.js').close()
+var common = require('./lib/common.js')
+var config = {
+  proxy: {
+    http: 'http://proxy.npm:8088/',
+    https: 'https://proxy.npm:8043/',
+    localAddress: 'localhost.localdomain'
+  },
+  ssl: {
+    ca: 'not including a PEM',
+    certificate: 'still not including a PEM',
+    key: 'nope',
+    strict: false
+  },
+  retry: {
+    count: 1,
+    factor: 9001,
+    minTimeout: -1,
+    maxTimeout: Infinity
+  },
+  userAgent: 'npm-awesome/4 (Mozilla 5.0)',
+  log: { fake: function () {} },
+  defaultTag: 'next',
+  couchToken: { object: true },
+  sessionToken: 'hamchunx'
+}
+
+test('config defaults', function (t) {
+  var client = common.freshClient(config)
+
+  var proxy = client.config.proxy
+  t.equal(proxy.http, 'http://proxy.npm:8088/')
+  t.equal(proxy.https, 'https://proxy.npm:8043/')
+  t.equal(proxy.localAddress, 'localhost.localdomain')
+
+  var ssl = client.config.ssl
+  t.equal(ssl.ca, 'not including a PEM')
+  t.equal(ssl.certificate, 'still not including a PEM')
+  t.equal(ssl.key, 'nope')
+  t.equal(ssl.strict, false)
+
+  var retry = client.config.retry
+  t.equal(retry.count, 1)
+  t.equal(retry.factor, 9001)
+  t.equal(retry.minTimeout, -1)
+  t.equal(retry.maxTimeout, Infinity)
+
+  t.equal(client.config.userAgent, 'npm-awesome/4 (Mozilla 5.0)')
+  t.ok(client.log.fake)
+  t.equal(client.config.defaultTag, 'next')
+  t.ok(client.config.couchToken.object)
+  t.equal(client.config.sessionToken, 'hamchunx')
+
+  t.end()
+})