Skip to content

Add possibility to filter Karma spec files by path

Inactive Account requested to merge winh-single-karma-test into master

What does this MR do?

Adds the possibility to run a single Karma spec file (or multiple specific files) with the custom cli argument --filter-spec or short -f. This works for yarn karma, yarn karma-coverage and yarn karma-start. For brevity the following examples are just with yarn karma:

# Run all files
yarn karma
# Run specific spec files
yarn karma --filter-spec spec/javascripts/profile/account/components/update_username_spec.js
# Run specific spec folder
yarn karma --filter-spec spec/javascripts/profile/account/components/
# Run all specs that match vue_shared OR vue_mr_widget
yarn karma -f vue_shared -f vue_mr_widget

Why was this MR needed?

To create a better developer experience. fdescribe no more!

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/40899

Edited by Lukas 'ai-pi' Eipert

Merge request reports