diff --git a/.github/hooks/pre-push b/.github/hooks/pre-push index be5569ad18..4bd60f9f17 100755 --- a/.github/hooks/pre-push +++ b/.github/hooks/pre-push @@ -5,13 +5,13 @@ echo "Running ESLint & Karma" npm run lint lint=$? if [ $lint -ne 0 ]; then - echo "ESLint Failed. Please fix the errors and push again. \n\n\n\n" + echo "ESLint Failed. Please fix the errors and push again." exit 1 fi -karma start --browsers=PhantomJS --reporters=mocha +npm run karma:hook karma=$? if [ $karma -ne 0 ]; then - echo "Karma Failed. Please fix the failing unit tests and push again. \n\n\n\n" + echo "Karma Failed. Please fix the failing unit tests and push again." exit 1 fi diff --git a/package.json b/package.json index dfd41070cf..e98f8b0aa4 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,8 @@ "lint:styles": "stylelint './src/css/**/*.less'", "lint:tests": "eslint './test/*.js'", "preversion": "grunt && grunt clean:docs && npm run docs && git add docs", - "test": "karma start" + "test": "karma start", + "karma:hook": "karma start --browsers=PhantomJS --reporters=mocha" }, "engines": { "node": ">=4.3.1"