From 3e593b82218fe3b03f0350d0fd411f8981b66301 Mon Sep 17 00:00:00 2001 From: Jason Kurian Date: Wed, 23 Mar 2016 20:35:48 -0400 Subject: [PATCH] chore(test.typings): instrument against examples folder chore(typing_spec): delete unused typing_spec files Closes #7743 --- gulpfile.js | 25 ++++++++++++++--- .../examples/facade/ts/async/observable.ts | 2 +- typing_spec/basic_spec.ts | 15 ---------- typing_spec/router_spec.ts | 28 ------------------- 4 files changed, 22 insertions(+), 48 deletions(-) delete mode 100644 typing_spec/basic_spec.ts delete mode 100644 typing_spec/router_spec.ts diff --git a/gulpfile.js b/gulpfile.js index 3e335d804e..9cd1af5271 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -984,18 +984,35 @@ gulp.task('static-checks', ['!build.tools'], function(done) { // Make sure the two typings tests are isolated, by running this one in a tempdir var tmpdir = path.join(os.tmpdir(), 'test.typings', new Date().getTime().toString()); gulp.task('!pre.test.typings.layoutNodeModule', ['build.js.cjs'], function() { - return gulp.src(['dist/js/cjs/angular2/**/*', 'node_modules/rxjs/**'], {base: 'dist/js/cjs'}) + return gulp.src(['dist/js/cjs/angular2/**/*', 'node_modules/rxjs/**/*'], {base: 'dist/js/cjs'}) .pipe(gulp.dest(path.join(tmpdir, 'node_modules'))); }); + +gulp.task('!pre.test.typings.copyDeps', function() { + return gulp.src( + [ + 'modules/angular2/typings/angular-protractor/*.ts', + 'modules/angular2/typings/jasmine/*.ts', + 'modules/angular2/typings/selenium-webdriver/*.ts', + ], + {base: 'modules/angular2/typings'}) + .pipe(gulp.dest(tmpdir)); +}); + gulp.task('!pre.test.typings.copyTypingsSpec', function() { - return gulp.src(['typing_spec/*.ts'], {base: 'typing_spec'}).pipe(gulp.dest(tmpdir)); + return gulp.src(['modules/angular2/examples/**/*.ts']).pipe(gulp.dest(tmpdir)); }); gulp.task('test.typings', - ['!pre.test.typings.layoutNodeModule', '!pre.test.typings.copyTypingsSpec'], function() { + [ + '!pre.test.typings.layoutNodeModule', + '!pre.test.typings.copyTypingsSpec', + '!pre.test.typings.copyDeps' + ], + function() { var tsc = require('gulp-typescript'); - return gulp.src([tmpdir + '/*.ts']) + return gulp.src([tmpdir + '/**/*.ts', '!' + tmpdir + '/node_modules/**/*']) .pipe(tsc({ target: 'ES6', module: 'commonjs', diff --git a/modules/angular2/examples/facade/ts/async/observable.ts b/modules/angular2/examples/facade/ts/async/observable.ts index a0f4bf0e16..6203a396f1 100644 --- a/modules/angular2/examples/facade/ts/async/observable.ts +++ b/modules/angular2/examples/facade/ts/async/observable.ts @@ -4,5 +4,5 @@ var obs = new Observable((obs: Subscriber) => { var i = 0; setInterval(() => { obs.next(++i); }, 1000); }); -obs.subscribe((i) => console.log(`${i} seconds elapsed`)); +obs.subscribe(i => console.log(`${i} seconds elapsed`)); // #enddocregion diff --git a/typing_spec/basic_spec.ts b/typing_spec/basic_spec.ts deleted file mode 100644 index 530681160b..0000000000 --- a/typing_spec/basic_spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import {Component} from 'angular2/core'; -import {bootstrap} from 'angular2/platform/browser'; - -@Component({ - selector: 'my-app', - template: '

Hello {{ name }}

' -}) -// Component controller -class MyAppComponent { - name: string; - - constructor() { this.name = 'Alice'; } -} - -bootstrap(MyAppComponent); diff --git a/typing_spec/router_spec.ts b/typing_spec/router_spec.ts deleted file mode 100644 index 4ae58801cd..0000000000 --- a/typing_spec/router_spec.ts +++ /dev/null @@ -1,28 +0,0 @@ -import {Component} from 'angular2/core'; -import {bootstrap} from 'angular2/platform/browser'; -import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS} from 'angular2/router'; - -@Component({ - selector: 'my-app', - template: '

Hello

', -}) -class FooCmp { - constructor(a: string, b: number) {} -} - - -@Component({ - selector: 'my-app', - template: '

Hello {{ name }}

', - directives: ROUTER_DIRECTIVES -}) -@RouteConfig([ - {path: '/home', component: FooCmp} -]) -class MyAppComponent { - name: string; - - constructor() { this.name = 'Alice'; } -} - -bootstrap(MyAppComponent, ROUTER_PROVIDERS);