From 3979a71849073e790c992300c918547b385cecdd Mon Sep 17 00:00:00 2001 From: Matt Travi Date: Mon, 31 Oct 2016 00:39:50 -0500 Subject: [PATCH] added license to the package file for #2 --- app/index.js | 3 ++- test/integration/features/step_definitions/files.js | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/index.js b/app/index.js index 44fb4c2..3f9ffbd 100644 --- a/app/index.js +++ b/app/index.js @@ -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') }); } }); diff --git a/test/integration/features/step_definitions/files.js b/test/integration/features/step_definitions/files.js index 194eb93..ec161f0 100644 --- a/test/integration/features/step_definitions/files.js +++ b/test/integration/features/step_definitions/files.js @@ -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')) @@ -18,6 +19,7 @@ module.exports = function () { initializing, prompting() { this.config.set('projectName', projectName); + this.config.set('license', license); } }), '@travi/git']]) .on('end', callback); @@ -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(); });