From d7c692a85d13b08d7fe791593e66af41a3cbddba Mon Sep 17 00:00:00 2001 From: Hussam Ghazzi Date: Tue, 29 Aug 2017 11:18:48 -0400 Subject: [PATCH] Hook: Run Karma Locally (#2284) * Hook: Run Karma Locally * Remove newlines * Rename Script --- .github/hooks/pre-push | 6 +++--- package.json | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) 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"