Skip to content

Commit 819d42d

Browse files
flavianhJonathan Ginsburg
authored and
Jonathan Ginsburg
committed
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.
1 parent 963269d commit 819d42d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ module.exports = function(config) {
2828
}
2929
```
3030

31-
If you want to run only some tests matching a given pattern you can do this in the following way
31+
If you want to run only some tests whose name match a given pattern you can do this in the following way
3232

3333
```bash
3434
$ karma start &
3535
$ karma run -- --grep=<pattern>
3636
```
3737

38-
or
38+
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").
39+
40+
You can also pass it to `karma.config.js`:
3941

4042
```js
4143
module.exports = function(config) {

0 commit comments

Comments
 (0)