chore(test.typings): instrument against examples folder
chore(typing_spec): delete unused typing_spec files Closes #7743
This commit is contained in:
parent
440aca86a3
commit
3e593b8221
25
gulpfile.js
25
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
|
// 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());
|
var tmpdir = path.join(os.tmpdir(), 'test.typings', new Date().getTime().toString());
|
||||||
gulp.task('!pre.test.typings.layoutNodeModule', ['build.js.cjs'], function() {
|
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')));
|
.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() {
|
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',
|
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');
|
var tsc = require('gulp-typescript');
|
||||||
|
|
||||||
return gulp.src([tmpdir + '/*.ts'])
|
return gulp.src([tmpdir + '/**/*.ts', '!' + tmpdir + '/node_modules/**/*'])
|
||||||
.pipe(tsc({
|
.pipe(tsc({
|
||||||
target: 'ES6',
|
target: 'ES6',
|
||||||
module: 'commonjs',
|
module: 'commonjs',
|
||||||
|
|
|
@ -4,5 +4,5 @@ var obs = new Observable<number>((obs: Subscriber<number>) => {
|
||||||
var i = 0;
|
var i = 0;
|
||||||
setInterval(() => { obs.next(++i); }, 1000);
|
setInterval(() => { obs.next(++i); }, 1000);
|
||||||
});
|
});
|
||||||
obs.subscribe((i) => console.log(`${i} seconds elapsed`));
|
obs.subscribe(i => console.log(`${i} seconds elapsed`));
|
||||||
// #enddocregion
|
// #enddocregion
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
import {Component} from 'angular2/core';
|
|
||||||
import {bootstrap} from 'angular2/platform/browser';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'my-app',
|
|
||||||
template: '<h1>Hello {{ name }}</h1>'
|
|
||||||
})
|
|
||||||
// Component controller
|
|
||||||
class MyAppComponent {
|
|
||||||
name: string;
|
|
||||||
|
|
||||||
constructor() { this.name = 'Alice'; }
|
|
||||||
}
|
|
||||||
|
|
||||||
bootstrap(MyAppComponent);
|
|
|
@ -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: '<h1>Hello</h1>',
|
|
||||||
})
|
|
||||||
class FooCmp {
|
|
||||||
constructor(a: string, b: number) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'my-app',
|
|
||||||
template: '<h1>Hello {{ name }}</h1><router-outlet></router-outlet>',
|
|
||||||
directives: ROUTER_DIRECTIVES
|
|
||||||
})
|
|
||||||
@RouteConfig([
|
|
||||||
{path: '/home', component: FooCmp}
|
|
||||||
])
|
|
||||||
class MyAppComponent {
|
|
||||||
name: string;
|
|
||||||
|
|
||||||
constructor() { this.name = 'Alice'; }
|
|
||||||
}
|
|
||||||
|
|
||||||
bootstrap(MyAppComponent, ROUTER_PROVIDERS);
|
|
Loading…
Reference in New Issue