final-config
Version:
Asynchronous configuration loading from various sources
21 lines (18 loc) • 401 B
JavaScript
const factory = require('../lib/factory')
test('config factory', async (done) => {
const config = factory([
{
type: 'StaticConfig',
config: { bar: { two: 2 } }
},
{
type: 'FileJsonConfig',
dir: __dirname,
base: 'config.json'
}
])
config.on('load', () => {
expect(config.toJS()).toEqual({ foo: { bar: 1 }, bar: { two: 2 } })
done()
})
})