Explorar o código

build: added precommit

Torkel Ödegaard %!s(int64=8) %!d(string=hai) anos
pai
achega
cde87d9adc

+ 3 - 2
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": {

+ 1 - 1
public/app/core/components/colorpicker/ColorPickerPopover.tsx

@@ -87,7 +87,7 @@ export class ColorPickerPopover extends React.Component<IProps, any> {
     );
     const spectrumTab = (
       <div id="spectrum">
-        <SpectrumPicker color={this.state.color} onColorSelect={this.spectrumColorSelected.bind(this)} options={{}} />
+        <fSpectrumPicker color={this.state.color} onColorSelect={this.spectrumColorSelected.bind(this)} options={{}} />
       </div>
     );
     const currentTab = this.state.tab === 'palette' ? paletteTab : spectrumTab;

+ 1 - 1
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

+ 7 - 0
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');