From cde87d9adc77d07f0f1c2675c7605fc2c0b07d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Sun, 22 Oct 2017 15:11:37 +0200 Subject: [PATCH] build: added precommit --- package.json | 5 +++-- .../app/core/components/colorpicker/ColorPickerPopover.tsx | 2 +- scripts/circle-test.sh | 2 +- scripts/grunt/default_task.js | 7 +++++++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9e47b02f7a6..c48f36f4616 100644 --- a/package.json +++ b/package.json @@ -99,10 +99,11 @@ "watch": "./node_modules/.bin/webpack --progress --colors --watch --config scripts/webpack/webpack.dev.js", "build": "./node_modules/.bin/grunt build", "test": "./node_modules/.bin/grunt test", - "test-ci": "./node_modules/.bin/grunt test --coverage=true", + "test:coverage": "./node_modules/.bin/grunt test --coverage=true", "lint": "./node_modules/.bin/tslint -c tslint.json --project tsconfig.json --type-check", "karma": "./node_modules/grunt-cli/bin/grunt karma:dev", - "jest": "./node_modules/jest-cli/bin/jest.js --notify --watch" + "jest": "./node_modules/jest-cli/bin/jest.js --notify --watch", + "precommit": "grunt precommit" }, "license": "Apache-2.0", "dependencies": { diff --git a/public/app/core/components/colorpicker/ColorPickerPopover.tsx b/public/app/core/components/colorpicker/ColorPickerPopover.tsx index 4677eee22a7..4d868f0aa3c 100644 --- a/public/app/core/components/colorpicker/ColorPickerPopover.tsx +++ b/public/app/core/components/colorpicker/ColorPickerPopover.tsx @@ -87,7 +87,7 @@ export class ColorPickerPopover extends React.Component { ); const spectrumTab = (
- +
); const currentTab = this.state.tab === 'palette' ? paletteTab : spectrumTab; diff --git a/scripts/circle-test.sh b/scripts/circle-test.sh index ca0ec6124d0..19772adebc7 100755 --- a/scripts/circle-test.sh +++ b/scripts/circle-test.sh @@ -16,7 +16,7 @@ rm -rf node_modules npm install -g yarn --quiet yarn install --pure-lockfile --no-progress -exit_if_fail npm run test-ci +exit_if_fail npm run test:coverage exit_if_fail npm run build # publish code coverage diff --git a/scripts/grunt/default_task.js b/scripts/grunt/default_task.js index d4c1f75e95e..03cd270b28e 100644 --- a/scripts/grunt/default_task.js +++ b/scripts/grunt/default_task.js @@ -19,6 +19,13 @@ module.exports = function(grunt) { 'no-only-tests' ]); + grunt.registerTask('precommit', [ + 'sasslint', + 'exec:tslint', + "exec:jest", + 'no-only-tests' + ]); + grunt.registerTask('no-only-tests', function() { var files = grunt.file.expand('public/**/*_specs\.ts', 'public/**/*_specs\.js');