From 96cfb04dae4d8bfe3a4d4a67f0e3a79137d2481e Mon Sep 17 00:00:00 2001 From: Mike Brocchi Date: Fri, 12 Aug 2016 11:51:59 -0400 Subject: [PATCH] chore(components): standardize options for component generation --- addon/ng2/blueprints/component/index.js | 6 +++--- tests/acceptance/generate-component.spec.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addon/ng2/blueprints/component/index.js b/addon/ng2/blueprints/component/index.js index 77e77c63e95c..235552fcc8c4 100644 --- a/addon/ng2/blueprints/component/index.js +++ b/addon/ng2/blueprints/component/index.js @@ -15,7 +15,7 @@ module.exports = { { name: 'inline-template', type: Boolean, default: false, aliases: ['it'] }, { name: 'inline-style', type: Boolean, default: false, aliases: ['is'] }, { name: 'prefix', type: Boolean, default: true }, - { name: 'nospec', type: Boolean, default: false } + { name: 'spec', type: Boolean, default: true } ], normalizeEntityName: function (entityName) { @@ -50,7 +50,7 @@ module.exports = { return { dynamicPath: this.dynamicPath.dir.replace(this.dynamicPath.appRoot, ''), flat: options.flat, - nospec: options.nospec, + spec: options.spec, inlineTemplate: options.inlineTemplate, inlineStyle: options.inlineStyle, route: options.route, @@ -70,7 +70,7 @@ module.exports = { if (this.options && this.options.inlineStyle) { fileList = fileList.filter(p => p.indexOf('.__styleext__') < 0); } - if (this.options && this.options.nospec) { + if (this.options && !this.options.spec) { fileList = fileList.filter(p => p.indexOf('__name__.component.spec.ts') < 0); } diff --git a/tests/acceptance/generate-component.spec.js b/tests/acceptance/generate-component.spec.js index 16916d8ddbe8..ec1e4f82291c 100644 --- a/tests/acceptance/generate-component.spec.js +++ b/tests/acceptance/generate-component.spec.js @@ -176,8 +176,8 @@ describe('Acceptance: ng generate component', function () { }); }); - it('my-comp --nospec', function() { - return ng(['generate', 'component', 'my-comp', '--nospec']).then(() => { + it('my-comp --no-spec', function() { + return ng(['generate', 'component', 'my-comp', '--no-spec']).then(() => { var testPath = path.join(root, 'tmp', 'foo', 'src', 'app', 'my-comp', 'my-comp.component.spec.ts'); expect(existsSync(testPath)).to.equal(false); });