feat(typings): add typing specs

add test in gulpfile which will compile a basic TS file with generated
angular2.d.ts to ensure generated d.ts is valid syntactic TS

Adds support for enums in .d.ts generation pipeline.
Removes renaming reexports in http module.
This commit is contained in:
Daria Jung
2015-06-16 10:46:12 -07:00
committed by Rado Kirov
parent 6149ce28a7
commit 24646e7eb8
13 changed files with 102 additions and 19 deletions

View File

@ -389,7 +389,7 @@ function runKarma(configFile, done) {
gulp.task('test.js', function(done) {
runSequence('test.unit.tools/ci', 'test.transpiler.unittest', 'docs/test', 'test.unit.js/ci',
'test.unit.cjs/ci', sequenceComplete(done));
'test.unit.cjs/ci', 'test.typings', sequenceComplete(done));
});
gulp.task('test.dart', function(done) {
@ -559,7 +559,6 @@ gulp.task('test.transpiler.unittest', function(done) {
runJasmineTests(['tools/transpiler/unittest/**/*.js'], done);
});
// -----------------
// Pre/Post-test checks
@ -567,12 +566,36 @@ gulp.task('pre-test-checks', function(done) {
runSequence('build/checkCircularDependencies', sequenceComplete(done));
});
gulp.task('post-test-checks', function(done) {
runSequence('enforce-format', sequenceComplete(done));
});
gulp.task('!pre.test.typings', [], function(done) {
return gulp
.src([
'modules/angular2/typings/**/*'], {
base: 'modules/angular2/typings/**'
}
)
.pipe(gulp.dest('dist/docs/typings/*'));
});
// -----------------
// TODO: Use a version of TypeScript that matches what is used by DefinitelyTyped.
gulp.task('test.typings', ['!pre.test.typings'], function(done) {
var stream = gulp.src(['typings_spec/*.ts', 'dist/docs/typings/angular2/angular2.d.ts'])
.pipe(tsc({target: 'ES5', module: 'commonjs',
// Don't use the version of typescript that gulp-typescript depends on, we need 1.5
// see https://github.com/ivogabe/gulp-typescript#typescript-version
typescript: require('typescript')}))
.on('error', function(error) {
// nodejs doesn't propagate errors from the src stream into the final stream so we are
// forwarding the error into the final stream
stream.emit('error', error);
});
});
// -----------------
// orchestrated targets