build(gulp): fail on ddescribe / iit left in tests

Closes #10524
This commit is contained in:
Pawel Kozlowski 2016-09-15 21:08:34 +02:00 committed by Alex Eagle
parent 115f0fa842
commit fa39965a37
4 changed files with 52 additions and 5 deletions

View File

@ -84,7 +84,7 @@ gulp.task('public-api:enforce', (done) => {
childProcess
.spawn(
path.join(__dirname, pfScriptPath(`/node_modules/.bin/ts-api-guardian`)),
path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)),
['--verifyDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
.on('close', (errorCode) => {
if (errorCode !== 0) {
@ -102,13 +102,23 @@ gulp.task('public-api:update', ['build.sh'], (done) => {
childProcess
.spawn(
path.join(__dirname, pfScriptPath(`/node_modules/.bin/ts-api-guardian`)),
path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)),
['--outDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
.on('close', done);
});
// Checks tests for presence of ddescribe, fdescribe, fit, iit and fails the build if one of the focused tests is found.
// Currently xdescribe and xit are _not_ reported as errors since there are a couple of excluded tests in our code base.
gulp.task('check-tests', function() {
const ddescribeIit = require('gulp-ddescribe-iit');
return gulp.src([
'modules/**/*.spec.ts',
'modules/**/*_spec.ts',
]).pipe(ddescribeIit({allowDisabledTests: true}));
});
// Check the coding standards and programming errors
gulp.task('lint', [ 'format:enforce', 'tools:build'], () => {
gulp.task('lint', ['check-tests', 'format:enforce', 'tools:build'], () => {
const tslint = require('gulp-tslint');
// Built-in rules are at
// https://github.com/palantir/tslint#supported-rules

View File

@ -2666,6 +2666,20 @@
}
}
},
"gulp-ddescribe-iit": {
"version": "1.3.0",
"dependencies": {
"isarray": {
"version": "1.0.0"
},
"readable-stream": {
"version": "2.0.6"
},
"through2": {
"version": "2.0.1"
}
}
},
"gulp-diff": {
"version": "1.0.0",
"dependencies": {
@ -4671,5 +4685,5 @@
}
},
"name": "angular-srcs",
"version": "2.0.0-rc.7"
"version": "2.0.0"
}

24
npm-shrinkwrap.json generated
View File

@ -1,6 +1,6 @@
{
"name": "angular-srcs",
"version": "2.0.0-rc.7",
"version": "2.0.0",
"dependencies": {
"@types/angularjs": {
"version": "1.5.13-alpha",
@ -4216,6 +4216,28 @@
}
}
},
"gulp-ddescribe-iit": {
"version": "1.3.0",
"from": "gulp-ddescribe-iit@latest",
"resolved": "https://registry.npmjs.org/gulp-ddescribe-iit/-/gulp-ddescribe-iit-1.3.0.tgz",
"dependencies": {
"isarray": {
"version": "1.0.0",
"from": "isarray@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz"
},
"readable-stream": {
"version": "2.0.6",
"from": "readable-stream@>=2.0.0 <2.1.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz"
},
"through2": {
"version": "2.0.1",
"from": "through2@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/through2/-/through2-2.0.1.tgz"
}
}
},
"gulp-diff": {
"version": "1.0.0",
"from": "gulp-diff@>=1.0.0 <2.0.0",

View File

@ -49,6 +49,7 @@
"gulp-clang-format": "^1.0.23",
"gulp-connect": "^2.3.1",
"gulp-conventional-changelog": "^1.1.0",
"gulp-ddescribe-iit": "^1.3.0",
"gulp-tslint": "^6.1.1",
"incremental-dom": "^0.4.1",
"jasmine": "^2.4.1",