From 8600b09d24c452c5a7d3934d761f97aa6729133d Mon Sep 17 00:00:00 2001 From: baruchvlz Date: Sat, 3 Dec 2016 22:18:29 -0500 Subject: [PATCH 01/14] change URL query key name --- packages/angular-cli/tasks/doc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/angular-cli/tasks/doc.ts b/packages/angular-cli/tasks/doc.ts index 9ed47c1e206a..c144b71971e7 100644 --- a/packages/angular-cli/tasks/doc.ts +++ b/packages/angular-cli/tasks/doc.ts @@ -3,7 +3,7 @@ const opn = require('opn'); export const DocTask: any = Task.extend({ run: function(keyword: string) { - const searchUrl = `https://angular.io/docs/ts/latest/api/#!?apiFilter=${keyword}`; + const searchUrl = `https://angular.io/docs/ts/latest/api/#!?query=${keyword}`; return opn(searchUrl, { wait: false }); } }); From 62f8957b0c21b1f0d47744db965fa2fd4586ab18 Mon Sep 17 00:00:00 2001 From: baruchvlz Date: Sun, 4 Dec 2016 04:41:44 -0500 Subject: [PATCH 02/14] generate component with module made optional --- .../angular-cli/blueprints/module/index.js | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/angular-cli/blueprints/module/index.js b/packages/angular-cli/blueprints/module/index.js index 1ee4be43aea8..2395f2f08933 100644 --- a/packages/angular-cli/blueprints/module/index.js +++ b/packages/angular-cli/blueprints/module/index.js @@ -8,7 +8,8 @@ module.exports = { availableOptions: [ { name: 'spec', type: Boolean }, - { name: 'routing', type: Boolean, default: false } + { name: 'routing', type: Boolean, default: false }, + { name: 'component', type: Boolean, default: false } ], normalizeEntityName: function (entityName) { @@ -61,14 +62,16 @@ module.exports = { // Note that `this.generatePath` already contains `this.dasherizedModuleName` // So, the path will end like `name/name`, // which is correct for `name.component.ts` created in module `name` - var componentPath = path.join(this.generatePath, this.dasherizedModuleName); - options.entity.name = path.relative(this.dynamicPath.appRoot, componentPath); - options.flat = true; - options.route = false; - options.inlineTemplate = false; - options.inlineStyle = false; - options.prefix = true; - options.spec = true; - return Blueprint.load(path.join(__dirname, '../component')).install(options); + if (this.options && this.options.component) { + var componentPath = path.join(this.generatePath, this.dasherizedModuleName); + options.entity.name = path.relative(this.dynamicPath.appRoot, componentPath); + options.flat = true; + options.route = false; + options.inlineTemplate = false; + options.inlineStyle = false; + options.prefix = true; + options.spec = true; + return Blueprint.load(path.join(__dirname, '../component')).install(options); + } } }; From 41d0d87f86da3966748b8c7bcb621804f492a65d Mon Sep 17 00:00:00 2001 From: baruchvlz Date: Sun, 4 Dec 2016 04:52:51 -0500 Subject: [PATCH 03/14] revert changes done to module cause open PR --- .../angular-cli/blueprints/module/index.js | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/packages/angular-cli/blueprints/module/index.js b/packages/angular-cli/blueprints/module/index.js index 2395f2f08933..1ee4be43aea8 100644 --- a/packages/angular-cli/blueprints/module/index.js +++ b/packages/angular-cli/blueprints/module/index.js @@ -8,8 +8,7 @@ module.exports = { availableOptions: [ { name: 'spec', type: Boolean }, - { name: 'routing', type: Boolean, default: false }, - { name: 'component', type: Boolean, default: false } + { name: 'routing', type: Boolean, default: false } ], normalizeEntityName: function (entityName) { @@ -62,16 +61,14 @@ module.exports = { // Note that `this.generatePath` already contains `this.dasherizedModuleName` // So, the path will end like `name/name`, // which is correct for `name.component.ts` created in module `name` - if (this.options && this.options.component) { - var componentPath = path.join(this.generatePath, this.dasherizedModuleName); - options.entity.name = path.relative(this.dynamicPath.appRoot, componentPath); - options.flat = true; - options.route = false; - options.inlineTemplate = false; - options.inlineStyle = false; - options.prefix = true; - options.spec = true; - return Blueprint.load(path.join(__dirname, '../component')).install(options); - } + var componentPath = path.join(this.generatePath, this.dasherizedModuleName); + options.entity.name = path.relative(this.dynamicPath.appRoot, componentPath); + options.flat = true; + options.route = false; + options.inlineTemplate = false; + options.inlineStyle = false; + options.prefix = true; + options.spec = true; + return Blueprint.load(path.join(__dirname, '../component')).install(options); } }; From d6be3ea1e5a45bb7a7bf6c142993fad8dc4f70bf Mon Sep 17 00:00:00 2001 From: baruchvlz Date: Sun, 4 Dec 2016 04:54:39 -0500 Subject: [PATCH 04/14] components when generating module is optional --- .../angular-cli/blueprints/module/index.js | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/angular-cli/blueprints/module/index.js b/packages/angular-cli/blueprints/module/index.js index 1ee4be43aea8..2395f2f08933 100644 --- a/packages/angular-cli/blueprints/module/index.js +++ b/packages/angular-cli/blueprints/module/index.js @@ -8,7 +8,8 @@ module.exports = { availableOptions: [ { name: 'spec', type: Boolean }, - { name: 'routing', type: Boolean, default: false } + { name: 'routing', type: Boolean, default: false }, + { name: 'component', type: Boolean, default: false } ], normalizeEntityName: function (entityName) { @@ -61,14 +62,16 @@ module.exports = { // Note that `this.generatePath` already contains `this.dasherizedModuleName` // So, the path will end like `name/name`, // which is correct for `name.component.ts` created in module `name` - var componentPath = path.join(this.generatePath, this.dasherizedModuleName); - options.entity.name = path.relative(this.dynamicPath.appRoot, componentPath); - options.flat = true; - options.route = false; - options.inlineTemplate = false; - options.inlineStyle = false; - options.prefix = true; - options.spec = true; - return Blueprint.load(path.join(__dirname, '../component')).install(options); + if (this.options && this.options.component) { + var componentPath = path.join(this.generatePath, this.dasherizedModuleName); + options.entity.name = path.relative(this.dynamicPath.appRoot, componentPath); + options.flat = true; + options.route = false; + options.inlineTemplate = false; + options.inlineStyle = false; + options.prefix = true; + options.spec = true; + return Blueprint.load(path.join(__dirname, '../component')).install(options); + } } }; From 005352d81f3227b598eb04406a5b4687ec5d844b Mon Sep 17 00:00:00 2001 From: baruchvlz Date: Sun, 4 Dec 2016 21:28:12 -0500 Subject: [PATCH 05/14] tests updated for component flag --- tests/acceptance/generate-module.spec.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/acceptance/generate-module.spec.js b/tests/acceptance/generate-module.spec.js index fef9a2ed5091..c020a154c430 100644 --- a/tests/acceptance/generate-module.spec.js +++ b/tests/acceptance/generate-module.spec.js @@ -38,6 +38,14 @@ describe('Acceptance: ng generate module', function () { }); }); + it('should generate component when passed flag --component', function () { + return ng(['generate', 'module', 'my-module', '--component']).then( () => { + expect(existsSync(path.join(testPath, 'my-module', 'my-module.module.ts'))).to.equal(true); + expect(existsSync(path.join(testPath, 'my-module', 'my-module.module.spec.ts'))).to.equal(false); + expect(existsSync(path.join(testPath, 'my-module', 'my-module.component.ts'))).to.equal(true); + }) + }); + it('ng generate module my-module --spec', function () { return ng(['generate', 'module', 'my-module', '--spec']).then(() => { expect(existsSync(path.join(testPath, 'my-module', 'my-module.module.ts'))).to.equal(true); From 64f58b4181c0e85602c50a196dc87565cb5be526 Mon Sep 17 00:00:00 2001 From: baruchvlz Date: Sun, 4 Dec 2016 21:48:12 -0500 Subject: [PATCH 06/14] fix parent/child compnent test to fit new flag --- tests/acceptance/generate-module.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/generate-module.spec.js b/tests/acceptance/generate-module.spec.js index c020a154c430..9dd246507c9d 100644 --- a/tests/acceptance/generate-module.spec.js +++ b/tests/acceptance/generate-module.spec.js @@ -65,7 +65,7 @@ describe('Acceptance: ng generate module', function () { ng(['generate', 'module', 'parent/child']).then(() => { expect(existsSync(path.join(testPath, 'parent/child', 'child.module.ts'))).to.equal(true); expect(existsSync(path.join(testPath, 'parent/child', 'child.module.spec.ts'))).to.equal(false); - expect(existsSync(path.join(testPath, 'parent/child', 'child.component.ts'))).to.equal(true); + expect(existsSync(path.join(testPath, 'parent/child', 'child.component.ts'))).to.equal(false); }) ); }); From aa5252bc4f67c6107c8745f16831fd73066170c9 Mon Sep 17 00:00:00 2001 From: baruchvlz Date: Sun, 4 Dec 2016 21:58:47 -0500 Subject: [PATCH 07/14] updated test for parent/child module generate --- tests/acceptance/generate-module.spec.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/acceptance/generate-module.spec.js b/tests/acceptance/generate-module.spec.js index 9dd246507c9d..fba52f2c296f 100644 --- a/tests/acceptance/generate-module.spec.js +++ b/tests/acceptance/generate-module.spec.js @@ -69,4 +69,13 @@ describe('Acceptance: ng generate module', function () { }) ); }); + + it('should generate parent/child module and component when passed --component flag', function () { + return ng(['generate', 'module', 'parent']).then(() => + ng(['generate', 'module', 'parent/child', '--component']).then(() => { + expect(existsSync(path.join(testPath, 'parent/child', 'child.module.ts'))).to.equal(true); + expect(existsSync(path.join(testPath, 'parent/child', 'child.component.ts'))).to.equal(true); + }) + ); + }); }); From cf74ea1e7e4160311ff09fbec7ec7e3752eeea74 Mon Sep 17 00:00:00 2001 From: baruchvlz Date: Sun, 4 Dec 2016 23:46:05 -0500 Subject: [PATCH 08/14] removed component testing from basic module e2e --- tests/e2e/tests/generate/module/module-basic.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/e2e/tests/generate/module/module-basic.ts b/tests/e2e/tests/generate/module/module-basic.ts index 071c20f3bea7..df3ceb3781ad 100644 --- a/tests/e2e/tests/generate/module/module-basic.ts +++ b/tests/e2e/tests/generate/module/module-basic.ts @@ -11,10 +11,6 @@ export default function() { .then(() => expectFileToExist(moduleDir)) .then(() => expectFileToExist(join(moduleDir, 'test-module.module.ts'))) .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module.routing.ts')))) - .then(() => expectFileToExist(join(moduleDir, 'test-module.component.ts'))) - .then(() => expectFileToExist(join(moduleDir, 'test-module.component.spec.ts'))) - .then(() => expectFileToExist(join(moduleDir, 'test-module.component.html'))) - .then(() => expectFileToExist(join(moduleDir, 'test-module.component.css'))) .then(() => expectFileToMatch(join(moduleDir, 'test-module.module.ts'), 'TestModuleComponent')) // Try to run the unit tests. From 69acc9a8c23fe236fe367fd4a0634f4517e0233e Mon Sep 17 00:00:00 2001 From: baruchvlz Date: Mon, 5 Dec 2016 13:00:13 -0500 Subject: [PATCH 09/14] adjusted e2e test for generate module --- .../e2e/tests/generate/module/module-basic.ts | 4 +++- .../tests/generate/module/module-component.ts | 22 +++++++++++++++++++ .../tests/generate/module/module-routing.ts | 5 ----- 3 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 tests/e2e/tests/generate/module/module-component.ts diff --git a/tests/e2e/tests/generate/module/module-basic.ts b/tests/e2e/tests/generate/module/module-basic.ts index df3ceb3781ad..cecdce16d283 100644 --- a/tests/e2e/tests/generate/module/module-basic.ts +++ b/tests/e2e/tests/generate/module/module-basic.ts @@ -11,7 +11,9 @@ export default function() { .then(() => expectFileToExist(moduleDir)) .then(() => expectFileToExist(join(moduleDir, 'test-module.module.ts'))) .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module.routing.ts')))) - .then(() => expectFileToMatch(join(moduleDir, 'test-module.module.ts'), 'TestModuleComponent')) + .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module.component.ts')))) + .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module.spec.ts')))) + .then(() => expectFileToMatch(join(moduleDir, 'test-module.module.ts'), 'TestModuleModule')) // Try to run the unit tests. .then(() => ng('test', '--single-run')); diff --git a/tests/e2e/tests/generate/module/module-component.ts b/tests/e2e/tests/generate/module/module-component.ts new file mode 100644 index 000000000000..960247d5b228 --- /dev/null +++ b/tests/e2e/tests/generate/module/module-component.ts @@ -0,0 +1,22 @@ +import {join} from 'path'; +import {ng} from '../../../utils/process'; +import {expectFileToExist, expectFileToMatch} from '../../../utils/fs'; +import {expectToFail} from '../../../utils/utils'; + + +export default function() { + const moduleDir = join('src', 'app', 'test-module'); + + return ng('generate', 'module', 'test-module', '--component') + .then(() => expectFileToExist(moduleDir)) + .then(() => expectFileToExist(join(moduleDir, 'test-module.module.ts'))) + .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module.routing.ts')))) + .then(() => expectFileToExist(join(moduleDir, 'test-module.component.ts'))) + .then(() => expectFileToExist(join(moduleDir, 'test-module.component.spec.ts'))) + .then(() => expectFileToExist(join(moduleDir, 'test-module.component.html'))) + .then(() => expectFileToExist(join(moduleDir, 'test-module.component.css'))) + .then(() => expectFileToMatch(join(moduleDir, 'test-module.module.ts'), 'TestModuleModule')) + + // Try to run the unit tests. + .then(() => ng('test', '--single-run')); +} diff --git a/tests/e2e/tests/generate/module/module-routing.ts b/tests/e2e/tests/generate/module/module-routing.ts index 851d7ebdcf41..a7ee6387455a 100644 --- a/tests/e2e/tests/generate/module/module-routing.ts +++ b/tests/e2e/tests/generate/module/module-routing.ts @@ -10,11 +10,6 @@ export default function() { .then(() => expectFileToExist(moduleDir)) .then(() => expectFileToExist(join(moduleDir, 'test-module.module.ts'))) .then(() => expectFileToExist(join(moduleDir, 'test-module-routing.module.ts'))) - .then(() => expectFileToExist(join(moduleDir, 'test-module.component.ts'))) - .then(() => expectFileToExist(join(moduleDir, 'test-module.component.spec.ts'))) - .then(() => expectFileToExist(join(moduleDir, 'test-module.component.html'))) - .then(() => expectFileToExist(join(moduleDir, 'test-module.component.css'))) - // Try to run the unit tests. .then(() => ng('test', '--single-run')); } From 238752520682179903cfce6f05d96b242f9538f4 Mon Sep 17 00:00:00 2001 From: baruchvlz Date: Wed, 7 Dec 2016 00:39:15 -0500 Subject: [PATCH 10/14] ng g m creates module only with routing flag --- packages/angular-cli/blueprints/module/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/angular-cli/blueprints/module/index.js b/packages/angular-cli/blueprints/module/index.js index 2395f2f08933..c82dfdfa282a 100644 --- a/packages/angular-cli/blueprints/module/index.js +++ b/packages/angular-cli/blueprints/module/index.js @@ -8,8 +8,7 @@ module.exports = { availableOptions: [ { name: 'spec', type: Boolean }, - { name: 'routing', type: Boolean, default: false }, - { name: 'component', type: Boolean, default: false } + { name: 'routing', type: Boolean, default: false } ], normalizeEntityName: function (entityName) { @@ -60,9 +59,9 @@ module.exports = { afterInstall: function (options) { // Note that `this.generatePath` already contains `this.dasherizedModuleName` - // So, the path will end like `name/name`, + // So, the path will end like `name/name`, // which is correct for `name.component.ts` created in module `name` - if (this.options && this.options.component) { + if (this.options && this.options.routing) { var componentPath = path.join(this.generatePath, this.dasherizedModuleName); options.entity.name = path.relative(this.dynamicPath.appRoot, componentPath); options.flat = true; From 172dc6eb5375c738eb8dba5d8c71cd3e0f4a72cf Mon Sep 17 00:00:00 2001 From: baruchvlz Date: Wed, 7 Dec 2016 00:39:50 -0500 Subject: [PATCH 11/14] unit test for new generate module behavior --- tests/acceptance/generate-module.spec.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/acceptance/generate-module.spec.js b/tests/acceptance/generate-module.spec.js index fba52f2c296f..a4e38274da4c 100644 --- a/tests/acceptance/generate-module.spec.js +++ b/tests/acceptance/generate-module.spec.js @@ -35,12 +35,14 @@ describe('Acceptance: ng generate module', function () { return ng(['generate', 'module', 'my-module']).then(() => { expect(existsSync(path.join(testPath, 'my-module', 'my-module.module.ts'))).to.equal(true); expect(existsSync(path.join(testPath, 'my-module', 'my-module.module.spec.ts'))).to.equal(false); + expect(existsSync(path.join(testPath, 'my-module', 'my-module.component.ts'))).to.equal(false); }); }); - it('should generate component when passed flag --component', function () { - return ng(['generate', 'module', 'my-module', '--component']).then( () => { + it('ng generate module generate routing and component files when passed flag --routing', function () { + return ng(['generate', 'module', 'my-module', '--routing']).then( () => { expect(existsSync(path.join(testPath, 'my-module', 'my-module.module.ts'))).to.equal(true); + expect(existsSync(path.join(testPath, 'my-module', 'my-module-routing.module.ts'))).to.equal(true); expect(existsSync(path.join(testPath, 'my-module', 'my-module.module.spec.ts'))).to.equal(false); expect(existsSync(path.join(testPath, 'my-module', 'my-module.component.ts'))).to.equal(true); }) @@ -70,10 +72,12 @@ describe('Acceptance: ng generate module', function () { ); }); - it('should generate parent/child module and component when passed --component flag', function () { + it('ng generate module should generate parent/child module with routing and component files when passed --routing flag', function () { return ng(['generate', 'module', 'parent']).then(() => - ng(['generate', 'module', 'parent/child', '--component']).then(() => { + ng(['generate', 'module', 'parent/child', '--routing']).then(() => { expect(existsSync(path.join(testPath, 'parent/child', 'child.module.ts'))).to.equal(true); + expect(existsSync(path.join(testPath, 'parent/child', 'child-routing.module.ts'))).to.equal(true); + expect(existsSync(path.join(testPath, 'parent/child', 'child.module.spec.ts'))).to.equal(false); expect(existsSync(path.join(testPath, 'parent/child', 'child.component.ts'))).to.equal(true); }) ); From 5c52d913112eb461c04836d6cc2bdf859bd8904f Mon Sep 17 00:00:00 2001 From: baruchvlz Date: Wed, 7 Dec 2016 00:40:32 -0500 Subject: [PATCH 12/14] e2e tests for g m new behavior --- tests/e2e/tests/generate/module/module-basic.ts | 2 +- tests/e2e/tests/generate/module/module-routing.ts | 6 ++++++ .../module/{module-component.ts => module-spec.ts} | 10 ++++------ 3 files changed, 11 insertions(+), 7 deletions(-) rename tests/e2e/tests/generate/module/{module-component.ts => module-spec.ts} (60%) diff --git a/tests/e2e/tests/generate/module/module-basic.ts b/tests/e2e/tests/generate/module/module-basic.ts index cecdce16d283..a32e38b1b997 100644 --- a/tests/e2e/tests/generate/module/module-basic.ts +++ b/tests/e2e/tests/generate/module/module-basic.ts @@ -10,7 +10,7 @@ export default function() { return ng('generate', 'module', 'test-module') .then(() => expectFileToExist(moduleDir)) .then(() => expectFileToExist(join(moduleDir, 'test-module.module.ts'))) - .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module.routing.ts')))) + .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module-routing.module.ts')))) .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module.component.ts')))) .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module.spec.ts')))) .then(() => expectFileToMatch(join(moduleDir, 'test-module.module.ts'), 'TestModuleModule')) diff --git a/tests/e2e/tests/generate/module/module-routing.ts b/tests/e2e/tests/generate/module/module-routing.ts index a7ee6387455a..fadd8901988d 100644 --- a/tests/e2e/tests/generate/module/module-routing.ts +++ b/tests/e2e/tests/generate/module/module-routing.ts @@ -1,6 +1,7 @@ import {join} from 'path'; import {ng} from '../../../utils/process'; import {expectFileToExist} from '../../../utils/fs'; +import {expectToFail} from '../../../utils/utils'; export default function() { @@ -10,6 +11,11 @@ export default function() { .then(() => expectFileToExist(moduleDir)) .then(() => expectFileToExist(join(moduleDir, 'test-module.module.ts'))) .then(() => expectFileToExist(join(moduleDir, 'test-module-routing.module.ts'))) + .then(() => expectFileToExist(join(moduleDir, 'test-module.component.ts'))) + .then(() => expectFileToExist(join(moduleDir, 'test-module.component.spec.ts'))) + .then(() => expectFileToExist(join(moduleDir, 'test-module.component.html'))) + .then(() => expectFileToExist(join(moduleDir, 'test-module.component.css'))) + .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module.spec.ts')))) // Try to run the unit tests. .then(() => ng('test', '--single-run')); } diff --git a/tests/e2e/tests/generate/module/module-component.ts b/tests/e2e/tests/generate/module/module-spec.ts similarity index 60% rename from tests/e2e/tests/generate/module/module-component.ts rename to tests/e2e/tests/generate/module/module-spec.ts index 960247d5b228..68246bb0dd1f 100644 --- a/tests/e2e/tests/generate/module/module-component.ts +++ b/tests/e2e/tests/generate/module/module-spec.ts @@ -7,14 +7,12 @@ import {expectToFail} from '../../../utils/utils'; export default function() { const moduleDir = join('src', 'app', 'test-module'); - return ng('generate', 'module', 'test-module', '--component') + return ng('generate', 'module', 'test-module', '--spec') .then(() => expectFileToExist(moduleDir)) .then(() => expectFileToExist(join(moduleDir, 'test-module.module.ts'))) - .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module.routing.ts')))) - .then(() => expectFileToExist(join(moduleDir, 'test-module.component.ts'))) - .then(() => expectFileToExist(join(moduleDir, 'test-module.component.spec.ts'))) - .then(() => expectFileToExist(join(moduleDir, 'test-module.component.html'))) - .then(() => expectFileToExist(join(moduleDir, 'test-module.component.css'))) + .then(() => expectFileToExist(join(moduleDir, 'test-module.module.spec.ts'))) + .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module-routing.module.ts')))) + .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module.component.ts')))) .then(() => expectFileToMatch(join(moduleDir, 'test-module.module.ts'), 'TestModuleModule')) // Try to run the unit tests. From 4af16a9a213367169e73e6ae20ef68ae7d0c0e4a Mon Sep 17 00:00:00 2001 From: baruchvlz Date: Wed, 7 Dec 2016 02:44:31 -0500 Subject: [PATCH 13/14] remove spec test --- .../e2e/tests/generate/module/module-spec.ts | 20 ------------------- 1 file changed, 20 deletions(-) delete mode 100644 tests/e2e/tests/generate/module/module-spec.ts diff --git a/tests/e2e/tests/generate/module/module-spec.ts b/tests/e2e/tests/generate/module/module-spec.ts deleted file mode 100644 index 68246bb0dd1f..000000000000 --- a/tests/e2e/tests/generate/module/module-spec.ts +++ /dev/null @@ -1,20 +0,0 @@ -import {join} from 'path'; -import {ng} from '../../../utils/process'; -import {expectFileToExist, expectFileToMatch} from '../../../utils/fs'; -import {expectToFail} from '../../../utils/utils'; - - -export default function() { - const moduleDir = join('src', 'app', 'test-module'); - - return ng('generate', 'module', 'test-module', '--spec') - .then(() => expectFileToExist(moduleDir)) - .then(() => expectFileToExist(join(moduleDir, 'test-module.module.ts'))) - .then(() => expectFileToExist(join(moduleDir, 'test-module.module.spec.ts'))) - .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module-routing.module.ts')))) - .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module.component.ts')))) - .then(() => expectFileToMatch(join(moduleDir, 'test-module.module.ts'), 'TestModuleModule')) - - // Try to run the unit tests. - .then(() => ng('test', '--single-run')); -} From c97a322ba4d97618b60db6ad297b308683d879e4 Mon Sep 17 00:00:00 2001 From: baruchvlz Date: Wed, 7 Dec 2016 02:44:55 -0500 Subject: [PATCH 14/14] shorten test module name to keep 100 char limit --- .../e2e/tests/generate/module/module-basic.ts | 14 +++++++------- .../tests/generate/module/module-routing.ts | 18 +++++++++--------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/e2e/tests/generate/module/module-basic.ts b/tests/e2e/tests/generate/module/module-basic.ts index a32e38b1b997..382aad79f871 100644 --- a/tests/e2e/tests/generate/module/module-basic.ts +++ b/tests/e2e/tests/generate/module/module-basic.ts @@ -5,15 +5,15 @@ import {expectToFail} from '../../../utils/utils'; export default function() { - const moduleDir = join('src', 'app', 'test-module'); + const moduleDir = join('src', 'app', 'test'); - return ng('generate', 'module', 'test-module') + return ng('generate', 'module', 'test') .then(() => expectFileToExist(moduleDir)) - .then(() => expectFileToExist(join(moduleDir, 'test-module.module.ts'))) - .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module-routing.module.ts')))) - .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module.component.ts')))) - .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module.spec.ts')))) - .then(() => expectFileToMatch(join(moduleDir, 'test-module.module.ts'), 'TestModuleModule')) + .then(() => expectFileToExist(join(moduleDir, 'test.module.ts'))) + .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-routing.module.ts')))) + .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test.component.ts')))) + .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test.spec.ts')))) + .then(() => expectFileToMatch(join(moduleDir, 'test.module.ts'), 'TestModule')) // Try to run the unit tests. .then(() => ng('test', '--single-run')); diff --git a/tests/e2e/tests/generate/module/module-routing.ts b/tests/e2e/tests/generate/module/module-routing.ts index fadd8901988d..8b98e39d5918 100644 --- a/tests/e2e/tests/generate/module/module-routing.ts +++ b/tests/e2e/tests/generate/module/module-routing.ts @@ -5,17 +5,17 @@ import {expectToFail} from '../../../utils/utils'; export default function() { - const moduleDir = join('src', 'app', 'test-module'); + const moduleDir = join('src', 'app', 'test'); - return ng('generate', 'module', 'test-module', '--routing') + return ng('generate', 'module', 'test', '--routing') .then(() => expectFileToExist(moduleDir)) - .then(() => expectFileToExist(join(moduleDir, 'test-module.module.ts'))) - .then(() => expectFileToExist(join(moduleDir, 'test-module-routing.module.ts'))) - .then(() => expectFileToExist(join(moduleDir, 'test-module.component.ts'))) - .then(() => expectFileToExist(join(moduleDir, 'test-module.component.spec.ts'))) - .then(() => expectFileToExist(join(moduleDir, 'test-module.component.html'))) - .then(() => expectFileToExist(join(moduleDir, 'test-module.component.css'))) - .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test-module.spec.ts')))) + .then(() => expectFileToExist(join(moduleDir, 'test.module.ts'))) + .then(() => expectFileToExist(join(moduleDir, 'test-routing.module.ts'))) + .then(() => expectFileToExist(join(moduleDir, 'test.component.ts'))) + .then(() => expectFileToExist(join(moduleDir, 'test.component.spec.ts'))) + .then(() => expectFileToExist(join(moduleDir, 'test.component.html'))) + .then(() => expectFileToExist(join(moduleDir, 'test.component.css'))) + .then(() => expectToFail(() => expectFileToExist(join(moduleDir, 'test.spec.ts')))) // Try to run the unit tests. .then(() => ng('test', '--single-run')); }