diff --git a/addon/ng2/blueprints/component-test/files/src/app/components/__name__/__name__.spec.ts b/addon/ng2/blueprints/component-test/files/src/app/components/__name__/__name__.spec.ts index 7b432d5f8907..3352d5d81e4e 100644 --- a/addon/ng2/blueprints/component-test/files/src/app/components/__name__/__name__.spec.ts +++ b/addon/ng2/blueprints/component-test/files/src/app/components/__name__/__name__.spec.ts @@ -15,7 +15,7 @@ import {<%= classifiedModuleName %>} from './<%= dasherizedModuleName %>'; describe('<%= classifiedModuleName %> Component', () => { - beforeEachProviders(() => []); + beforeEachProviders((): any[] => []); it('should ...', injectAsync([TestComponentBuilder], (tcb:TestComponentBuilder) => { diff --git a/addon/ng2/blueprints/directive/files/src/app/directives/__name__/__name__.spec.ts b/addon/ng2/blueprints/directive/files/src/app/directives/__name__/__name__.spec.ts index ba4742da519b..0e5c50473136 100644 --- a/addon/ng2/blueprints/directive/files/src/app/directives/__name__/__name__.spec.ts +++ b/addon/ng2/blueprints/directive/files/src/app/directives/__name__/__name__.spec.ts @@ -15,13 +15,13 @@ import {<%= classifiedModuleName %>} from './<%= dasherizedModuleName %>'; @Component({ selector: 'test-component', - template: `
` + template: `
>
` }) class TestComponent {} describe('<%= classifiedModuleName %> Directive', () => { - beforeEachProviders(() => []); + beforeEachProviders((): any[] => []); it('should ...', injectAsync([TestComponentBuilder], (tcb:TestComponentBuilder) => { diff --git a/addon/ng2/blueprints/ng2/files/src/app/__name__.ts b/addon/ng2/blueprints/ng2/files/src/app/__name__.ts index 79ea23dcb529..4426740f4e4c 100644 --- a/addon/ng2/blueprints/ng2/files/src/app/__name__.ts +++ b/addon/ng2/blueprints/ng2/files/src/app/__name__.ts @@ -14,7 +14,7 @@ import {RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router'; ]) export class <%= jsComponentName %>App { defaultMeaning: number = 42; - + meaningOfLife(meaning?: number) { return `The meaning of life is ${meaning || this.defaultMeaning}`; } diff --git a/addon/ng2/blueprints/pipe/files/src/app/pipes/__name__/__name__.ts b/addon/ng2/blueprints/pipe/files/src/app/pipes/__name__/__name__.ts index 987f3cf56986..5d0bfcceb466 100644 --- a/addon/ng2/blueprints/pipe/files/src/app/pipes/__name__/__name__.ts +++ b/addon/ng2/blueprints/pipe/files/src/app/pipes/__name__/__name__.ts @@ -6,7 +6,7 @@ import {Pipe, PipeTransform} from 'angular2/core'; }) export class <%= classifiedModuleName %> implements PipeTransform { - transform(value, args?) { + transform(value: any, args?: any): any { return null; } diff --git a/tests/e2e/e2e_workflow.spec.js b/tests/e2e/e2e_workflow.spec.js index 992d75b90025..38f462e0fd5a 100644 --- a/tests/e2e/e2e_workflow.spec.js +++ b/tests/e2e/e2e_workflow.spec.js @@ -63,7 +63,7 @@ describe('Basic end-to-end Workflow', function () { 'build', '--silent' ]).then(function() { - expect(fs.existsSync(path.join(process.cwd(), 'dist'))); + expect(fs.existsSync(path.join(process.cwd(), 'dist'))).to.be.equal(true); }); }); @@ -174,8 +174,37 @@ describe('Basic end-to-end Workflow', function () { expect(result.exitCode).to.be.equal(0); // Clean `tmp` folder - process.chdir(path.resolve(root, '..')); - sh.rm('-rf', './tmp'); // tmp.teardown takes too long + // process.chdir(path.resolve(root, '..')); + // sh.rm('-rf', './tmp'); // tmp.teardown takes too long + }); + }); + + it('Turn on `noImplicitAny` in tsconfig.json and rebuild', function (done) { + this.timeout(420000); + + var configFilePath = path.join(process.cwd(), 'src', 'tsconfig.json'); + fs.readFile(configFilePath, 'utf8', function(err, data){ + + var config = JSON.parse(data); + config.compilerOptions.noImplicitAny = true; + + fs.writeFile(configFilePath, JSON.stringify(config), function(){ + //clear the dist folder + sh.rm('-rf', path.join(process.cwd(), 'dist')); + + return ng([ + 'build', + '--silent' + ]).then(function() { + expect(fs.existsSync(path.join(process.cwd(), 'dist'))).to.be.equal(true); + }) + .finally(function(){ + // Clean `tmp` folder + process.chdir(path.resolve(root, '..')); + sh.rm('-rf', './tmp'); // tmp.teardown takes too long + done(); + }); + }); }); });