Commit cdced6e4 by Andrej Ocenas Committed by GitHub

Merge pull request #16047 from grafana/grunt-no-only-tests-add-patterns

Add patterns to no-only-tests grunt task
parents ed1b0019 dcc5373e
...@@ -161,7 +161,7 @@ describe('change threshold value', () => { ...@@ -161,7 +161,7 @@ describe('change threshold value', () => {
}); });
describe('on blur threshold value', () => { describe('on blur threshold value', () => {
it.only('should resort rows and update indexes', () => { it('should resort rows and update indexes', () => {
const { instance } = setup(); const { instance } = setup();
const thresholds = [ const thresholds = [
{ index: 0, value: -Infinity, color: '#7EB26D' }, { index: 0, value: -Infinity, color: '#7EB26D' },
......
...@@ -34,14 +34,17 @@ module.exports = function (grunt) { ...@@ -34,14 +34,17 @@ module.exports = function (grunt) {
]); ]);
grunt.registerTask('no-only-tests', function () { grunt.registerTask('no-only-tests', function () {
var files = grunt.file.expand('public/**/*_specs\.ts', 'public/**/*_specs\.js'); var files = grunt.file.expand(
'public/**/*@(_specs|\.test)\.@(ts|js|tsx|jsx)',
'packages/grafana-ui/**/*@(_specs|\.test)\.@(ts|js|tsx|jsx)'
);
files.forEach(function (spec) { files.forEach(function (spec) {
var rows = grunt.file.read(spec).split('\n'); var rows = grunt.file.read(spec).split('\n');
rows.forEach(function (row) { rows.forEach(function (row) {
if (row.indexOf('.only(') > 0) { if (row.indexOf('.only(') > 0) {
grunt.log.errorlns(row); grunt.log.errorlns(row);
grunt.fail.warn('found only statement in test: ' + spec) 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