From 819d42dde80e4f0ddc204fa32ad2f0736dc8d144 Mon Sep 17 00:00:00 2001 From: Flavian Hautbois Date: Tue, 19 Apr 2022 14:59:13 +0100 Subject: [PATCH] docs: make grep behaviour clearer It is not self-explanatory that grep will recognize whether the input string is a regex or not. In the case of a string it sanitizes it to turn it into a regex. --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 319a610..1ef4c6d 100644 --- a/README.md +++ b/README.md @@ -28,14 +28,16 @@ module.exports = function(config) { } ``` -If you want to run only some tests matching a given pattern you can do this in the following way +If you want to run only some tests whose name match a given pattern you can do this in the following way ```bash $ karma start & $ karma run -- --grep= ``` -or +where pattern is either a string (e.g `--grep=#slow` runs tests containing "#slow") or a Regex (e.g `--grep=/^(?!.*#slow).*$/` runs tests _not_ containing "#slow"). + +You can also pass it to `karma.config.js`: ```js module.exports = function(config) {