Commit c238ba7f authored by Clement Ho's avatar Clement Ho

Merge branch 'winh-yarn-test-command' into 'master'

Introduce yarn test to run Jest and Karma

See merge request gitlab-org/gitlab-ce!26320
parents 75e24b8f 4fca4b79
......@@ -225,14 +225,12 @@ See this [section][vue-test].
### Running frontend tests
`rake karma` runs the frontend-only (JavaScript) tests.
It consists of two subtasks:
For running the frontend tests, you need the following commands:
- `rake karma:fixtures` (re-)generates fixtures
- `rake karma:tests` actually executes the tests
- `rake karma:fixtures` (re-)generates fixtures.
- `yarn test` executes the tests.
As long as the fixtures don't change, `rake karma:tests` (or `yarn karma`)
is sufficient (and saves you some time).
As long as the fixtures don't change, `yarn test` is sufficient (and saves you some time).
### Live testing and focused testing
......
......@@ -17,6 +17,7 @@
"prettier-all": "node ./scripts/frontend/prettier.js check-all",
"prettier-all-save": "node ./scripts/frontend/prettier.js save-all",
"stylelint": "node node_modules/stylelint/bin/stylelint.js app/assets/stylesheets/**/*.* --custom-formatter node_modules/stylelint-error-string-formatter",
"test": "yarn jest && yarn karma",
"webpack": "webpack --config config/webpack.config.js",
"webpack-prod": "NODE_ENV=production webpack --config config/webpack.config.js"
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment