Skip to content

Commit

Permalink
Add test-specific tslint (#464)
Browse files Browse the repository at this point in the history
* Add test-specific tslint

Fixes #379

* Enable newTestOnly as proof-of-concept
  • Loading branch information
ascandella authored and jpoon committed Jul 17, 2016
1 parent 910666d commit f152ee1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
21 changes: 15 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ var gulp = require('gulp'),
filter = require('gulp-filter'),
tag_version = require('gulp-tag-version'),
inject = require('gulp-inject-string'),
trimlines = require('gulp-trimlines');
trimlines = require('gulp-trimlines'),
merge = require('merge-stream');

var paths = {
src_ts: "src/**/*.ts",
Expand All @@ -23,7 +24,7 @@ function versionBump(importance) {
.pipe(filter('package.json'))
.pipe(tag_version());
}

gulp.task('patch', function() { return versionBump('patch'); })
gulp.task('minor', function() { return versionBump('minor'); })
gulp.task('major', function() { return versionBump('major'); })
Expand Down Expand Up @@ -57,11 +58,19 @@ gulp.task('fix-whitespace', function() {
});

gulp.task('tslint', ['fix-whitespace'], function() {
return gulp.src([paths.src_ts, paths.tests_ts])
var tslintOptions = {
summarizeFailureOutput: true
};

var srcs = gulp.src(paths.src_ts)
.pipe(tslint())
.pipe(tslint.report('prose', {
summarizeFailureOutput: true
}));
.pipe(tslint.report('prose', tslintOptions));
var tests = gulp.src(paths.tests_ts)
.pipe(tslint({
configuration: 'test/tslint.json'
}))
.pipe(tslint.report('prose', tslintOptions));
return merge(srcs, tests);
});

gulp.task('compile', shell.task([
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@
"gulp-tslint": "^5.0.0",
"gulp-typescript": "^2.13.4",
"gulp-typings": "^2.0.0",
"merge-stream": "^1.0.0",
"tslint": "^3.10.2",
"typescript": "2.0.0",
"typings": "^1.0.4",
"vscode": "^0.11.13"
}
}
}
2 changes: 1 addition & 1 deletion test/mode/modeNormal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ suite("Mode Normal", () => {

let {
newTest,
// newTestOnly
newTestOnly
} = getTestingFunctions(modeHandler);

setup(async () => {
Expand Down
6 changes: 6 additions & 0 deletions test/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../tslint.json",
"rules": {
"no-unused-variable": false
}
}

0 comments on commit f152ee1

Please sign in to comment.