Skip to content

Commit fa39965

Browse files
pkozlowski-opensourcealexeagle
authored andcommitted
build(gulp): fail on ddescribe / iit left in tests
Closes angular#10524
1 parent 115f0fa commit fa39965

File tree

4 files changed

+52
-5
lines changed

4 files changed

+52
-5
lines changed

gulpfile.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ gulp.task('public-api:enforce', (done) => {
8484

8585
childProcess
8686
.spawn(
87-
path.join(__dirname, pfScriptPath(`/node_modules/.bin/ts-api-guardian`)),
87+
path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)),
8888
['--verifyDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
8989
.on('close', (errorCode) => {
9090
if (errorCode !== 0) {
@@ -102,13 +102,23 @@ gulp.task('public-api:update', ['build.sh'], (done) => {
102102

103103
childProcess
104104
.spawn(
105-
path.join(__dirname, pfScriptPath(`/node_modules/.bin/ts-api-guardian`)),
105+
path.join(__dirname, platformScriptPath(`/node_modules/.bin/ts-api-guardian`)),
106106
['--outDir', publicApiDir].concat(publicApiArgs), {stdio: 'inherit'})
107107
.on('close', done);
108108
});
109109

110+
// Checks tests for presence of ddescribe, fdescribe, fit, iit and fails the build if one of the focused tests is found.
111+
// Currently xdescribe and xit are _not_ reported as errors since there are a couple of excluded tests in our code base.
112+
gulp.task('check-tests', function() {
113+
const ddescribeIit = require('gulp-ddescribe-iit');
114+
return gulp.src([
115+
'modules/**/*.spec.ts',
116+
'modules/**/*_spec.ts',
117+
]).pipe(ddescribeIit({allowDisabledTests: true}));
118+
});
119+
110120
// Check the coding standards and programming errors
111-
gulp.task('lint', [ 'format:enforce', 'tools:build'], () => {
121+
gulp.task('lint', ['check-tests', 'format:enforce', 'tools:build'], () => {
112122
const tslint = require('gulp-tslint');
113123
// Built-in rules are at
114124
// https://github.com/palantir/tslint#supported-rules

npm-shrinkwrap.clean.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2666,6 +2666,20 @@
26662666
}
26672667
}
26682668
},
2669+
"gulp-ddescribe-iit": {
2670+
"version": "1.3.0",
2671+
"dependencies": {
2672+
"isarray": {
2673+
"version": "1.0.0"
2674+
},
2675+
"readable-stream": {
2676+
"version": "2.0.6"
2677+
},
2678+
"through2": {
2679+
"version": "2.0.1"
2680+
}
2681+
}
2682+
},
26692683
"gulp-diff": {
26702684
"version": "1.0.0",
26712685
"dependencies": {
@@ -4671,5 +4685,5 @@
46714685
}
46724686
},
46734687
"name": "angular-srcs",
4674-
"version": "2.0.0-rc.7"
4688+
"version": "2.0.0"
46754689
}

npm-shrinkwrap.json

Lines changed: 23 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"gulp-clang-format": "^1.0.23",
5050
"gulp-connect": "^2.3.1",
5151
"gulp-conventional-changelog": "^1.1.0",
52+
"gulp-ddescribe-iit": "^1.3.0",
5253
"gulp-tslint": "^6.1.1",
5354
"incremental-dom": "^0.4.1",
5455
"jasmine": "^2.4.1",

0 commit comments

Comments
 (0)