• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1require('../common-config.js')
2
3var path = require('path')
4var fs = require('fs')
5var test = require('tap').test
6var npmconf = require('../../lib/config/core.js')
7
8test('cafile loads as ca', function (t) {
9  var cafile = path.join(__dirname, '..', 'fixtures', 'config', 'multi-ca')
10
11  npmconf.load({cafile: cafile}, function (er, conf) {
12    if (er) throw er
13
14    t.same(conf.get('cafile'), cafile)
15    var ca = fs.readFileSync(cafile, 'utf8').trim()
16    t.same(conf.get('ca').join(ca.match(/\r/g) ? '\r\n' : '\n'), ca)
17    t.end()
18  })
19})
20