documentation/test/lib/load_config.js
2015-10-03 16:57:37 -04:00

21 lines
478 B
JavaScript

'use strict';
var test = require('tap').test,
path = require('path'),
loadConfig = require('../../lib/load_config');
test('loadConfig', function (t) {
t.throws(function () {
loadConfig('DOES-NOT-EXIST');
});
t.deepEqual(loadConfig(path.join(__dirname, '../config_fixture/config.json')),
{ foo: 'bar' });
t.deepEqual(loadConfig(path.join(__dirname, '../config_fixture/config_comments.json')),
{ foo: 'bar' }, 'config with comments');
t.end();
});