UNPKG

476 BJavaScriptView Raw
1var test = require('tap').test
2var npmconf = require('../npmconf.js')
3var common = require('./00-setup.js')
4var path = require('path')
5var fs = require('fs')
6
7test('cafile loads as ca', function (t) {
8 var cafile = path.join(__dirname, 'fixtures', 'multi-ca')
9
10 npmconf.load({cafile: cafile}, function (er, conf) {
11 if (er) throw er
12
13 t.same(conf.get('cafile'), cafile)
14 t.same(conf.get('ca').join('\n'), fs.readFileSync(cafile, 'utf8').trim())
15 t.end()
16 })
17})