Skip to content
This repository has been archived by the owner on Apr 13, 2018. It is now read-only.

Commit

Permalink
added license to the package file for #2
Browse files Browse the repository at this point in the history
  • Loading branch information
travi committed Oct 31, 2016
1 parent 289ecd5 commit 3979a71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ module.exports = yeoman.Base.extend({

writing() {
this.fs.writeJSON(this.destinationPath('package.json'), {
name: this.config.get('projectName')
name: this.config.get('projectName'),
license: this.config.get('license')
});
}
});
7 changes: 6 additions & 1 deletion test/integration/features/step_definitions/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const tempDir = path.join(__dirname, 'temp');
module.exports = function () {
const initializing = sinon.spy();
const projectName = any.word();
const license = any.word();

this.When(/^the generator is run$/, function (callback) {
helpers.run(path.join(__dirname, '../../../../app'))
Expand All @@ -18,6 +19,7 @@ module.exports = function () {
initializing,
prompting() {
this.config.set('projectName', projectName);
this.config.set('license', license);
}
}), '@travi/git']])
.on('end', callback);
Expand All @@ -35,7 +37,10 @@ module.exports = function () {
'package.json'
]);
assert.fileContent('.gitignore', 'node_modules/\n');
assert.jsonFileContent(`${tempDir}/package.json`, {name: projectName});
assert.jsonFileContent(`${tempDir}/package.json`, {
name: projectName,
license
});

callback();
});
Expand Down

0 comments on commit 3979a71

Please sign in to comment.