Welcome to mirror list, hosted at ThFree Co, Russian Federation.

config-certfile.js « tap « test - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 25de9963a9fc960d0d21e7d0ca5cafd12281a9dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require("./00-config-setup.js")

var path = require("path")
var fs = require("fs")
var test = require("tap").test
var npmconf = require("../../lib/config/core.js")

test("cafile loads as ca", function (t) {
  var cafile = path.join(__dirname, "..", "fixtures", "config", "multi-ca")

  npmconf.load({cafile: cafile}, function (er, conf) {
    if (er) throw er

    t.same(conf.get("cafile"), cafile)
    t.same(conf.get("ca").join("\n"), fs.readFileSync(cafile, "utf8").trim())
    t.end()
  })
})