From 9016091adf8ef71f46380806b0a027479bcba1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20G=C3=A9rardy?= Date: Fri, 1 Jun 2018 20:18:24 +0200 Subject: [PATCH] [ospec] docs and change log --- ospec/README.md | 17 ++++++++++++++--- ospec/change-log.md | 3 +++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ospec/README.md b/ospec/README.md index 4b71e74f..bbc929c4 100644 --- a/ospec/README.md +++ b/ospec/README.md @@ -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) + }) }) ``` diff --git a/ospec/change-log.md b/ospec/change-log.md index 095a0743..01d0e884 100644 --- a/ospec/change-log.md +++ b/ospec/change-log.md @@ -12,12 +12,15 @@ _2018-xx-yy_ - Give async timeout a stack trace that points to the problematic test ([#2154](https://github.com/MithrilJS/mithril.js/pull/2154) [@gilbert](github.com/gilbert), [#2167](https://github.com/MithrilJS/mithril.js/pull/2167)) - deprecate the `timeout` parameter in async tests in favour of `o.timeout()` for setting the timeout delay. The `timeout` parameter still works for v3, and will be removed in v4 ([#2167](https://github.com/MithrilJS/mithril.js/pull/2167)) - add `o.defaultTimeout()` for setting the the timeout delay for the current spec and its children ([#2167](https://github.com/MithrilJS/mithril.js/pull/2167)) +- adds the possibility select more than one test with o.only ([#2171](https://github.com/MithrilJS/mithril.js/pull/2171)) ### Bug fixes - Detect duplicate calls to `done()` properly [#2162](https://github.com/MithrilJS/mithril.js/issues/2162) ([#2167](https://github.com/MithrilJS/mithril.js/pull/2167)) - Don't try to report internal errors as assertion failures, throw them instead ([#2167](https://github.com/MithrilJS/mithril.js/pull/2167)) - Don't ignore, silently, tests whose name start with the test suite meta-information sequence (was `"__"` up to this version) ([#2167](https://github.com/MithrilJS/mithril.js/pull/2167)) - Fix the `done()` call detection logic [#2158](https://github.com/MithrilJS/mithril.js/issues/2158) and assorted fixes (accept non-English names, tolerate comments) ([#2167](https://github.com/MithrilJS/mithril.js/pull/2167)) +- Catch exceptions thrown in synchronous tests and report them as assertion failures ([#2171](https://github.com/MithrilJS/mithril.js/pull/2171)) +- Fix a stack overflow when using `o.only()` with a large test suite ([#2171](https://github.com/MithrilJS/mithril.js/pull/2171)) ## 2.1.0 _2018-05-25_