From e696dc4d5f895d0c17ff3e02ac2c9181d2b234ab Mon Sep 17 00:00:00 2001 From: Tobias Skarhed Date: Tue, 14 Aug 2018 09:28:08 +0200 Subject: [PATCH] Remove Karma scripts and docs --- .github/CONTRIBUTING.md | 6 ++++- README.md | 12 ++-------- docs/sources/project/building_from_source.md | 8 +++---- package.json | 10 --------- scripts/grunt/default_task.js | 1 - scripts/grunt/options/karma.js | 23 -------------------- 6 files changed, 10 insertions(+), 50 deletions(-) delete mode 100644 scripts/grunt/options/karma.js diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index fe0a1d6c548..f0f4e19bfc3 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -7,7 +7,11 @@ grunt && grunt watch ### Rerun tests on source change ``` -grunt karma:dev +npm jest +``` +or +``` +yarn jest ``` ### Run tests for backend assets before commit diff --git a/README.md b/README.md index d6083bb1504..71fdb04cea6 100644 --- a/README.md +++ b/README.md @@ -59,11 +59,6 @@ Run tests yarn run jest ``` -Run karma tests -```bash -yarn run karma -``` - ### Recompile backend on source change To rebuild on source change. @@ -101,14 +96,11 @@ Execute all frontend tests yarn run test ``` -Writing & watching frontend tests (we have two test runners) +Writing & watching frontend tests - jest for all new tests that do not require browser context (React+more) - Start watcher: `yarn run jest` - - Jest will run all test files that end with the name ".jest.ts" -- karma + mocha is used for testing angularjs components. We do want to migrate these test to jest over time (if possible). - - Start watcher: `yarn run karma` - - Karma+Mocha runs all files that end with the name "_specs.ts". + - Jest will run all test files that end with the name ".test.ts" #### Backend ```bash diff --git a/docs/sources/project/building_from_source.md b/docs/sources/project/building_from_source.md index a0b553594ce..20c177211e3 100644 --- a/docs/sources/project/building_from_source.md +++ b/docs/sources/project/building_from_source.md @@ -90,14 +90,12 @@ You'll also need to run `npm run watch` to watch for changes to the front-end (t - You can run backend Golang tests using "go test ./pkg/...". - Execute all frontend tests with "npm run test" -Writing & watching frontend tests (we have two test runners) +Writing & watching frontend tests - jest for all new tests that do not require browser context (React+more) - Start watcher: `npm run jest` - - Jest will run all test files that end with the name ".jest.ts" -- karma + mocha is used for testing angularjs components. We do want to migrate these test to jest over time (if possible). - - Start watcher: `npm run karma` - - Karma+Mocha runs all files that end with the name "_specs.ts". + - Jest will run all test files that end with the name ".test.ts" + ## Creating optimized release packages diff --git a/package.json b/package.json index 24e23b574df..87615e8273b 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,6 @@ "grunt-contrib-copy": "~1.0.0", "grunt-contrib-cssmin": "~1.0.2", "grunt-exec": "^1.0.1", - "grunt-karma": "~2.0.0", "grunt-notify": "^0.4.5", "grunt-postcss": "^0.8.0", "grunt-sass": "^2.0.0", @@ -58,14 +57,6 @@ "html-webpack-plugin": "^3.2.0", "husky": "^0.14.3", "jest": "^22.0.4", - "karma": "1.7.0", - "karma-chrome-launcher": "~2.2.0", - "karma-expect": "~1.1.3", - "karma-mocha": "~1.3.0", - "karma-phantomjs-launcher": "1.0.4", - "karma-sinon": "^1.0.5", - "karma-sourcemap-loader": "^0.3.7", - "karma-webpack": "^3.0.0", "lint-staged": "^6.0.0", "load-grunt-tasks": "3.5.2", "mini-css-extract-plugin": "^0.4.0", @@ -112,7 +103,6 @@ "test": "grunt test", "test:coverage": "grunt test --coverage=true", "lint": "tslint -c tslint.json --project tsconfig.json --type-check", - "karma": "grunt karma:dev", "jest": "jest --notify --watch", "api-tests": "jest --notify --watch --config=tests/api/jest.js", "precommit": "lint-staged && grunt precommit" diff --git a/scripts/grunt/default_task.js b/scripts/grunt/default_task.js index efcdcd02963..07519cdd6c8 100644 --- a/scripts/grunt/default_task.js +++ b/scripts/grunt/default_task.js @@ -12,7 +12,6 @@ module.exports = function(grunt) { 'sasslint', 'exec:tslint', "exec:jest", - 'karma:test', 'no-only-tests' ]); diff --git a/scripts/grunt/options/karma.js b/scripts/grunt/options/karma.js deleted file mode 100644 index 9f638d2e36d..00000000000 --- a/scripts/grunt/options/karma.js +++ /dev/null @@ -1,23 +0,0 @@ -module.exports = function (config) { - 'use strict'; - - return { - dev: { - configFile: 'karma.conf.js', - singleRun: false, - }, - - debug: { - configFile: 'karma.conf.js', - singleRun: false, - browsers: ['Chrome'], - mime: { - 'text/x-typescript': ['ts', 'tsx'] - }, - }, - - test: { - configFile: 'karma.conf.js', - } - }; -};