From cbf59c6086138b29d60703c9e94d7c5020f78d02 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Sat, 13 Feb 2016 00:09:39 +0000 Subject: [PATCH 1/3] fix(tests): use current package in e2e tests --- tests/e2e/e2e_workflow.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/e2e_workflow.spec.js b/tests/e2e/e2e_workflow.spec.js index 00a81ca039d2..c53c8c2b1301 100644 --- a/tests/e2e/e2e_workflow.spec.js +++ b/tests/e2e/e2e_workflow.spec.js @@ -18,11 +18,10 @@ describe('Basic end-to-end Workflow', function () { it('Installs angular-cli correctly', function() { this.timeout(300000); + sh.exec('npm link', { silent: true }); return tmp.setup('./tmp') .then(function () { process.chdir('./tmp'); - - sh.exec('npm i angular-cli -g -C ' + process.cwd(), { silent: true }); expect(fs.existsSync(path.join(process.cwd(), 'bin', 'ng'))); }); }); @@ -41,6 +40,7 @@ describe('Basic end-to-end Workflow', function () { it('Can change current working directory to `test-project`', function() { process.chdir(path.join(root, 'test-project')); + sh.exec('npm link angular-cli', { silent: true }); expect(path.basename(process.cwd())).to.equal('test-project'); }); From 13bceb741d3faacee4cdeb925db983db614b4b67 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Sat, 13 Feb 2016 00:59:04 +0000 Subject: [PATCH 2/3] use relative npm link --- tests/e2e/e2e_workflow.spec.js | 278 ++++++++++++++++----------------- 1 file changed, 139 insertions(+), 139 deletions(-) diff --git a/tests/e2e/e2e_workflow.spec.js b/tests/e2e/e2e_workflow.spec.js index c53c8c2b1301..f61f8059fd6e 100644 --- a/tests/e2e/e2e_workflow.spec.js +++ b/tests/e2e/e2e_workflow.spec.js @@ -40,146 +40,146 @@ describe('Basic end-to-end Workflow', function () { it('Can change current working directory to `test-project`', function() { process.chdir(path.join(root, 'test-project')); - sh.exec('npm link angular-cli', { silent: true }); + sh.exec('npm link ../../angular-cli', { silent: true }); expect(path.basename(process.cwd())).to.equal('test-project'); }); - - it('Can run `ng build` in created project', function() { - this.timeout(10000); - - return ng([ - 'build', - '--silent' - ]).then(function() { - expect(fs.existsSync(path.join(process.cwd(), 'dist'))); - }); - }); - - it('Perform `ng test`', function(done) { - this.timeout(30000); - - return ng([ - 'test' - ]).then(function(err) { - // TODO when `ng test` will be implemented - //expect(err).to.be.equal(1); - done(); - }); - }); - - it('Can create a test component using `ng generate component test-component`', function() { - return ng([ - 'generate', - 'component', - 'test-component' - ]).then(function() { - var componentDir = path.join(process.cwd(), 'src', 'app', 'components', 'test-component'); - expect(fs.existsSync(componentDir)); - expect(fs.existsSync(path.join(componentDir, 'test-component.ts'))); - expect(fs.existsSync(path.join(componentDir, 'test-component.html'))); - expect(fs.existsSync(path.join(componentDir, 'test-component.css'))); - }); - }); - - it('Perform `ng test`', function(done) { - this.timeout(30000); - - return ng([ - 'test' - ]).then(function(err) { - // TODO when `ng test` will be implemented - //expect(err).to.be.equal(1); - done(); - }); - }); - - it('Can create a test service using `ng generate service test-service`', function() { - return ng([ - 'generate', - 'service', - 'test-service' - ]).then(function() { - var serviceDir = path.join(process.cwd(), 'src', 'app', 'services', 'test-service'); - expect(fs.existsSync(serviceDir)); - expect(fs.existsSync(path.join(serviceDir, 'test-service.ts'))); - expect(fs.existsSync(path.join(serviceDir, 'test-service.spec.ts'))); - }); - }); - - it('Perform `ng test`', function(done) { - this.timeout(30000); - - return ng([ - 'test' - ]).then(function(err) { - // TODO when `ng test` will be implemented - //expect(err).to.be.equal(1); - done(); - }); - }); - - it('Can create a test pipe using `ng generate pipe test-pipe`', function() { - return ng([ - 'generate', - 'pipe', - 'test-pipe' - ]).then(function() { - var pipeDir = path.join(process.cwd(), 'src', 'app', 'pipes', 'test-pipe'); - expect(fs.existsSync(pipeDir)); - expect(fs.existsSync(path.join(pipeDir, 'test-pipe.ts'))); - expect(fs.existsSync(path.join(pipeDir, 'test-pipe.spec.ts'))); - }); - }); - - it('Perform `ng test`', function(done) { - this.timeout(30000); - - return ng([ - 'test' - ]).then(function(err) { - // TODO when `ng test` will be implemented - //expect(err).to.be.equal(1); - done(); - }); - }); - - it('Can create a test route using `ng generate route test-route`', function() { - return ng([ - 'generate', - 'route', - 'test-route' - ]).then(function() { - var routeDir = path.join(process.cwd(), 'src', 'app', 'test-route'); - expect(fs.existsSync(routeDir)); - expect(fs.existsSync(path.join(routeDir, 'test-pipe-detail.component.css'))); - expect(fs.existsSync(path.join(routeDir, 'test-pipe-detail.component.html'))); - expect(fs.existsSync(path.join(routeDir, 'test-pipe-detail.component.spec.ts'))); - expect(fs.existsSync(path.join(routeDir, 'test-pipe-detail.component.ts'))); - expect(fs.existsSync(path.join(routeDir, 'test-pipe-list.component.css'))); - expect(fs.existsSync(path.join(routeDir, 'test-pipe-list.component.html'))); - expect(fs.existsSync(path.join(routeDir, 'test-pipe-list.component.spec.ts'))); - expect(fs.existsSync(path.join(routeDir, 'test-pipe-list.component.ts'))); - expect(fs.existsSync(path.join(routeDir, 'test-pipe-root.component.ts'))); - expect(fs.existsSync(path.join(routeDir, 'test-pipe-root.service.spec.ts'))); - expect(fs.existsSync(path.join(routeDir, 'test-pipe-root.service.ts'))); - }); - }); - - it('Perform `ng test`', function(done) { - this.timeout(300000); - - return ng([ - 'test' - ]).then(function(err) { - // TODO when `ng test` will be implemented - //expect(err).to.be.equal(1); - // Clean `tmp` folder - - process.chdir(path.resolve(root, '..')); - sh.rm('-rf', './tmp'); // tmp.teardown takes too long - - done(); - }); - }); + // + // it('Can run `ng build` in created project', function() { + // this.timeout(10000); + // + // return ng([ + // 'build', + // '--silent' + // ]).then(function() { + // expect(fs.existsSync(path.join(process.cwd(), 'dist'))); + // }); + // }); + // + // it('Perform `ng test`', function(done) { + // this.timeout(30000); + // + // return ng([ + // 'test' + // ]).then(function(err) { + // // TODO when `ng test` will be implemented + // //expect(err).to.be.equal(1); + // done(); + // }); + // }); + // + // it('Can create a test component using `ng generate component test-component`', function() { + // return ng([ + // 'generate', + // 'component', + // 'test-component' + // ]).then(function() { + // var componentDir = path.join(process.cwd(), 'src', 'app', 'components', 'test-component'); + // expect(fs.existsSync(componentDir)); + // expect(fs.existsSync(path.join(componentDir, 'test-component.ts'))); + // expect(fs.existsSync(path.join(componentDir, 'test-component.html'))); + // expect(fs.existsSync(path.join(componentDir, 'test-component.css'))); + // }); + // }); + // + // it('Perform `ng test`', function(done) { + // this.timeout(30000); + // + // return ng([ + // 'test' + // ]).then(function(err) { + // // TODO when `ng test` will be implemented + // //expect(err).to.be.equal(1); + // done(); + // }); + // }); + // + // it('Can create a test service using `ng generate service test-service`', function() { + // return ng([ + // 'generate', + // 'service', + // 'test-service' + // ]).then(function() { + // var serviceDir = path.join(process.cwd(), 'src', 'app', 'services', 'test-service'); + // expect(fs.existsSync(serviceDir)); + // expect(fs.existsSync(path.join(serviceDir, 'test-service.ts'))); + // expect(fs.existsSync(path.join(serviceDir, 'test-service.spec.ts'))); + // }); + // }); + // + // it('Perform `ng test`', function(done) { + // this.timeout(30000); + // + // return ng([ + // 'test' + // ]).then(function(err) { + // // TODO when `ng test` will be implemented + // //expect(err).to.be.equal(1); + // done(); + // }); + // }); + // + // it('Can create a test pipe using `ng generate pipe test-pipe`', function() { + // return ng([ + // 'generate', + // 'pipe', + // 'test-pipe' + // ]).then(function() { + // var pipeDir = path.join(process.cwd(), 'src', 'app', 'pipes', 'test-pipe'); + // expect(fs.existsSync(pipeDir)); + // expect(fs.existsSync(path.join(pipeDir, 'test-pipe.ts'))); + // expect(fs.existsSync(path.join(pipeDir, 'test-pipe.spec.ts'))); + // }); + // }); + // + // it('Perform `ng test`', function(done) { + // this.timeout(30000); + // + // return ng([ + // 'test' + // ]).then(function(err) { + // // TODO when `ng test` will be implemented + // //expect(err).to.be.equal(1); + // done(); + // }); + // }); + // + // it('Can create a test route using `ng generate route test-route`', function() { + // return ng([ + // 'generate', + // 'route', + // 'test-route' + // ]).then(function() { + // var routeDir = path.join(process.cwd(), 'src', 'app', 'test-route'); + // expect(fs.existsSync(routeDir)); + // expect(fs.existsSync(path.join(routeDir, 'test-pipe-detail.component.css'))); + // expect(fs.existsSync(path.join(routeDir, 'test-pipe-detail.component.html'))); + // expect(fs.existsSync(path.join(routeDir, 'test-pipe-detail.component.spec.ts'))); + // expect(fs.existsSync(path.join(routeDir, 'test-pipe-detail.component.ts'))); + // expect(fs.existsSync(path.join(routeDir, 'test-pipe-list.component.css'))); + // expect(fs.existsSync(path.join(routeDir, 'test-pipe-list.component.html'))); + // expect(fs.existsSync(path.join(routeDir, 'test-pipe-list.component.spec.ts'))); + // expect(fs.existsSync(path.join(routeDir, 'test-pipe-list.component.ts'))); + // expect(fs.existsSync(path.join(routeDir, 'test-pipe-root.component.ts'))); + // expect(fs.existsSync(path.join(routeDir, 'test-pipe-root.service.spec.ts'))); + // expect(fs.existsSync(path.join(routeDir, 'test-pipe-root.service.ts'))); + // }); + // }); + // + // it('Perform `ng test`', function(done) { + // this.timeout(300000); + // + // return ng([ + // 'test' + // ]).then(function(err) { + // // TODO when `ng test` will be implemented + // //expect(err).to.be.equal(1); + // // Clean `tmp` folder + // + // process.chdir(path.resolve(root, '..')); + // sh.rm('-rf', './tmp'); // tmp.teardown takes too long + // + // done(); + // }); + // }); }); From a61d821652d53c97dfe875caa81dd96aeab1d614 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Sat, 13 Feb 2016 01:02:47 +0000 Subject: [PATCH 3/3] remove commented tests --- tests/e2e/e2e_workflow.spec.js | 276 ++++++++++++++++----------------- 1 file changed, 138 insertions(+), 138 deletions(-) diff --git a/tests/e2e/e2e_workflow.spec.js b/tests/e2e/e2e_workflow.spec.js index f61f8059fd6e..bab60a71bf99 100644 --- a/tests/e2e/e2e_workflow.spec.js +++ b/tests/e2e/e2e_workflow.spec.js @@ -43,143 +43,143 @@ describe('Basic end-to-end Workflow', function () { sh.exec('npm link ../../angular-cli', { silent: true }); expect(path.basename(process.cwd())).to.equal('test-project'); }); - // - // it('Can run `ng build` in created project', function() { - // this.timeout(10000); - // - // return ng([ - // 'build', - // '--silent' - // ]).then(function() { - // expect(fs.existsSync(path.join(process.cwd(), 'dist'))); - // }); - // }); - // - // it('Perform `ng test`', function(done) { - // this.timeout(30000); - // - // return ng([ - // 'test' - // ]).then(function(err) { - // // TODO when `ng test` will be implemented - // //expect(err).to.be.equal(1); - // done(); - // }); - // }); - // - // it('Can create a test component using `ng generate component test-component`', function() { - // return ng([ - // 'generate', - // 'component', - // 'test-component' - // ]).then(function() { - // var componentDir = path.join(process.cwd(), 'src', 'app', 'components', 'test-component'); - // expect(fs.existsSync(componentDir)); - // expect(fs.existsSync(path.join(componentDir, 'test-component.ts'))); - // expect(fs.existsSync(path.join(componentDir, 'test-component.html'))); - // expect(fs.existsSync(path.join(componentDir, 'test-component.css'))); - // }); - // }); - // - // it('Perform `ng test`', function(done) { - // this.timeout(30000); - // - // return ng([ - // 'test' - // ]).then(function(err) { - // // TODO when `ng test` will be implemented - // //expect(err).to.be.equal(1); - // done(); - // }); - // }); - // - // it('Can create a test service using `ng generate service test-service`', function() { - // return ng([ - // 'generate', - // 'service', - // 'test-service' - // ]).then(function() { - // var serviceDir = path.join(process.cwd(), 'src', 'app', 'services', 'test-service'); - // expect(fs.existsSync(serviceDir)); - // expect(fs.existsSync(path.join(serviceDir, 'test-service.ts'))); - // expect(fs.existsSync(path.join(serviceDir, 'test-service.spec.ts'))); - // }); - // }); - // - // it('Perform `ng test`', function(done) { - // this.timeout(30000); - // - // return ng([ - // 'test' - // ]).then(function(err) { - // // TODO when `ng test` will be implemented - // //expect(err).to.be.equal(1); - // done(); - // }); - // }); - // - // it('Can create a test pipe using `ng generate pipe test-pipe`', function() { - // return ng([ - // 'generate', - // 'pipe', - // 'test-pipe' - // ]).then(function() { - // var pipeDir = path.join(process.cwd(), 'src', 'app', 'pipes', 'test-pipe'); - // expect(fs.existsSync(pipeDir)); - // expect(fs.existsSync(path.join(pipeDir, 'test-pipe.ts'))); - // expect(fs.existsSync(path.join(pipeDir, 'test-pipe.spec.ts'))); - // }); - // }); - // - // it('Perform `ng test`', function(done) { - // this.timeout(30000); - // - // return ng([ - // 'test' - // ]).then(function(err) { - // // TODO when `ng test` will be implemented - // //expect(err).to.be.equal(1); - // done(); - // }); - // }); - // - // it('Can create a test route using `ng generate route test-route`', function() { - // return ng([ - // 'generate', - // 'route', - // 'test-route' - // ]).then(function() { - // var routeDir = path.join(process.cwd(), 'src', 'app', 'test-route'); - // expect(fs.existsSync(routeDir)); - // expect(fs.existsSync(path.join(routeDir, 'test-pipe-detail.component.css'))); - // expect(fs.existsSync(path.join(routeDir, 'test-pipe-detail.component.html'))); - // expect(fs.existsSync(path.join(routeDir, 'test-pipe-detail.component.spec.ts'))); - // expect(fs.existsSync(path.join(routeDir, 'test-pipe-detail.component.ts'))); - // expect(fs.existsSync(path.join(routeDir, 'test-pipe-list.component.css'))); - // expect(fs.existsSync(path.join(routeDir, 'test-pipe-list.component.html'))); - // expect(fs.existsSync(path.join(routeDir, 'test-pipe-list.component.spec.ts'))); - // expect(fs.existsSync(path.join(routeDir, 'test-pipe-list.component.ts'))); - // expect(fs.existsSync(path.join(routeDir, 'test-pipe-root.component.ts'))); - // expect(fs.existsSync(path.join(routeDir, 'test-pipe-root.service.spec.ts'))); - // expect(fs.existsSync(path.join(routeDir, 'test-pipe-root.service.ts'))); - // }); - // }); - // - // it('Perform `ng test`', function(done) { - // this.timeout(300000); - // - // return ng([ - // 'test' - // ]).then(function(err) { - // // TODO when `ng test` will be implemented - // //expect(err).to.be.equal(1); - // // Clean `tmp` folder - // - // process.chdir(path.resolve(root, '..')); - // sh.rm('-rf', './tmp'); // tmp.teardown takes too long - // - // done(); - // }); - // }); + + it('Can run `ng build` in created project', function() { + this.timeout(10000); + + return ng([ + 'build', + '--silent' + ]).then(function() { + expect(fs.existsSync(path.join(process.cwd(), 'dist'))); + }); + }); + + it('Perform `ng test`', function(done) { + this.timeout(30000); + + return ng([ + 'test' + ]).then(function(err) { + // TODO when `ng test` will be implemented + //expect(err).to.be.equal(1); + done(); + }); + }); + + it('Can create a test component using `ng generate component test-component`', function() { + return ng([ + 'generate', + 'component', + 'test-component' + ]).then(function() { + var componentDir = path.join(process.cwd(), 'src', 'app', 'components', 'test-component'); + expect(fs.existsSync(componentDir)); + expect(fs.existsSync(path.join(componentDir, 'test-component.ts'))); + expect(fs.existsSync(path.join(componentDir, 'test-component.html'))); + expect(fs.existsSync(path.join(componentDir, 'test-component.css'))); + }); + }); + + it('Perform `ng test`', function(done) { + this.timeout(30000); + + return ng([ + 'test' + ]).then(function(err) { + // TODO when `ng test` will be implemented + //expect(err).to.be.equal(1); + done(); + }); + }); + + it('Can create a test service using `ng generate service test-service`', function() { + return ng([ + 'generate', + 'service', + 'test-service' + ]).then(function() { + var serviceDir = path.join(process.cwd(), 'src', 'app', 'services', 'test-service'); + expect(fs.existsSync(serviceDir)); + expect(fs.existsSync(path.join(serviceDir, 'test-service.ts'))); + expect(fs.existsSync(path.join(serviceDir, 'test-service.spec.ts'))); + }); + }); + + it('Perform `ng test`', function(done) { + this.timeout(30000); + + return ng([ + 'test' + ]).then(function(err) { + // TODO when `ng test` will be implemented + //expect(err).to.be.equal(1); + done(); + }); + }); + + it('Can create a test pipe using `ng generate pipe test-pipe`', function() { + return ng([ + 'generate', + 'pipe', + 'test-pipe' + ]).then(function() { + var pipeDir = path.join(process.cwd(), 'src', 'app', 'pipes', 'test-pipe'); + expect(fs.existsSync(pipeDir)); + expect(fs.existsSync(path.join(pipeDir, 'test-pipe.ts'))); + expect(fs.existsSync(path.join(pipeDir, 'test-pipe.spec.ts'))); + }); + }); + + it('Perform `ng test`', function(done) { + this.timeout(30000); + + return ng([ + 'test' + ]).then(function(err) { + // TODO when `ng test` will be implemented + //expect(err).to.be.equal(1); + done(); + }); + }); + + it('Can create a test route using `ng generate route test-route`', function() { + return ng([ + 'generate', + 'route', + 'test-route' + ]).then(function() { + var routeDir = path.join(process.cwd(), 'src', 'app', 'test-route'); + expect(fs.existsSync(routeDir)); + expect(fs.existsSync(path.join(routeDir, 'test-pipe-detail.component.css'))); + expect(fs.existsSync(path.join(routeDir, 'test-pipe-detail.component.html'))); + expect(fs.existsSync(path.join(routeDir, 'test-pipe-detail.component.spec.ts'))); + expect(fs.existsSync(path.join(routeDir, 'test-pipe-detail.component.ts'))); + expect(fs.existsSync(path.join(routeDir, 'test-pipe-list.component.css'))); + expect(fs.existsSync(path.join(routeDir, 'test-pipe-list.component.html'))); + expect(fs.existsSync(path.join(routeDir, 'test-pipe-list.component.spec.ts'))); + expect(fs.existsSync(path.join(routeDir, 'test-pipe-list.component.ts'))); + expect(fs.existsSync(path.join(routeDir, 'test-pipe-root.component.ts'))); + expect(fs.existsSync(path.join(routeDir, 'test-pipe-root.service.spec.ts'))); + expect(fs.existsSync(path.join(routeDir, 'test-pipe-root.service.ts'))); + }); + }); + + it('Perform `ng test`', function(done) { + this.timeout(300000); + + return ng([ + 'test' + ]).then(function(err) { + // TODO when `ng test` will be implemented + //expect(err).to.be.equal(1); + // Clean `tmp` folder + + process.chdir(path.resolve(root, '..')); + sh.rm('-rf', './tmp'); // tmp.teardown takes too long + + done(); + }); + }); });