Commit 80818f80 by bergquist

tech(grunt): add check for not including "only" in tests

parent 822bf13b
......@@ -24,7 +24,7 @@ describe("Emitter", () => {
expect(sub2Called).to.be(true);
});
it.only('should handle errors', () => {
it('should handle errors', () => {
var events = new Emitter();
var sub1Called = 0;
var sub2Called = 0;
......
......@@ -25,6 +25,19 @@ module.exports = function(grunt) {
'typescript:build'
]);
grunt.registerTask('test', ['default', 'karma:test']);
grunt.registerTask('test', ['default', 'karma:test', 'no-only-tests']);
grunt.registerTask('no-only-tests', function() {
var files = grunt.file.expand('public/**/*_specs\.ts', 'public/**/*_specs\.js');
files.forEach(function(spec) {
var rows = grunt.file.read(spec).split('\n');
rows.forEach(function(row) {
if (row.indexOf('.only(') > 0) {
grunt.log.errorlns(row);
grunt.fail.warn('found only statement in test: ' + spec)
}
});
});
});
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment