Chromium Code Reviews| Index: lib/src/backend/invoker.dart |
| diff --git a/lib/src/backend/invoker.dart b/lib/src/backend/invoker.dart |
| index 68b1966abac375b3eba21e13668bf625018f4e18..854839ae21db2f3b29c355b80b64f9778fc775bc 100644 |
| --- a/lib/src/backend/invoker.dart |
| +++ b/lib/src/backend/invoker.dart |
| @@ -231,6 +231,26 @@ class Invoker { |
| }); |
| } |
| + /// Marks the current test as skipped. |
| + /// |
| + /// If passed, [message] is emitted as a skip message. |
| + /// |
| + /// Note that this *does not* mark the test as complete. |
|
kevmoo
2016/07/06 20:30:42
What *does* it do? Worth explaining a bit more, I
nweiz
2016/07/06 21:14:18
Done.
|
| + void skip([String message]) { |
| + if (liveTest.state.shouldBeDone) { |
| + // Set the state explicitly so we don't get an extra error about the test |
| + // failing after being complete. |
| + _controller.setState(const State(Status.complete, Result.error)); |
| + throw "This test was marked as skipped after it had already completed. " |
| + "Make sure to use\n" |
| + "[expectAsync] or the [completes] matcher when testing async code."; |
| + } |
| + |
| + if (message != null) _controller.message(new Message.skip(message)); |
| + // TODO: error if the test is already complete. |
| + _controller.setState(const State(Status.pending, Result.skipped)); |
| + } |
| + |
| /// Notifies the invoker of an asynchronous error. |
| void _handleError(error, [StackTrace stackTrace]) { |
| if (stackTrace == null) stackTrace = new Chain.current(); |