verb
Version:
Verb makes it easy to build project documentation using simple markdown templates, with zero configuration required.
34 lines (29 loc) • 1.06 kB
JavaScript
var expect = require('chai').expect;
var file = require('fs-utils');
// Local libs
var verb = require('../');
describe('options.config', function () {
describe('when the default config object is not overridden:', function () {
it('should extend the context with data from package.json', function () {
var actual = verb.process();
var expected = file.readJSONSync('test/expected/config-default.json');
actual = JSON.parse(JSON.stringify(actual));
expect(actual.name).to.eql(expected.name);
});
});
describe('when a custom config object is defined:', function () {
it('should extend that data into the context, but not data from package.json', function () {
var actual = verb.process('', {
config: {
name: 'Custom Config',
repository: {
"type": "git",
"url": "https://github.com/assemble/verb.git"
},
}
});
actual = JSON.parse(JSON.stringify(actual));
expect(actual.context.name).to.eql('Custom Config');
});
});
});