[ospec] docs and change log

This commit is contained in:
Pierre-Yves Gérardy 2018-06-01 20:18:24 +02:00 committed by Pierre-Yves Gérardy
parent 14695c9cda
commit 9016091adf
2 changed files with 17 additions and 3 deletions

View file

@ -271,20 +271,31 @@ o.spec("math", function() {
})
```
### Running only one test
### Running only some tests
A test can be temporarily made to run exclusively by calling `o.only()` instead of `o`. This is useful when troubleshooting regressions, to zero-in on a failing test, and to avoid saturating console log w/ irrelevant debug information.
One or more tests can be temporarily made to run exclusively by calling `o.only()` instead of `o`. This is useful when troubleshooting regressions, to zero-in on a failing test, and to avoid saturating console log w/ irrelevant debug information.
```javascript
o.spec("math", function() {
// will not run
o("addition", function() {
o(1 + 1).equals(2)
})
//only this test will be run, regardless of how many groups there are
// this test will be run, regardless of how many groups there are
o.only("subtraction", function() {
o(1 - 1).notEquals(2)
})
// will not run
o("multiplication", function() {
o(2 * 2).equals(4)
})
// this test will be run, regardless of how many groups there are
o.only("division", function() {
o(6 / 2).notEquals(2)
})
})
```