summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/npmconf/test/certfile.js
blob: 3dfb6e90f98207a00a2a0d8bb787bd0159b6921f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var test = require('tap').test
var npmconf = require('../npmconf.js')
var common = require('./00-setup.js')
var path = require('path')
var fs = require('fs')

test('cafile loads as ca', function (t) {
  var cafile = path.join(__dirname, 'fixtures', '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()
  })
})