Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better exception for markTestSkipped outside test #1599

Merged
merged 1 commit into from
Oct 13, 2021

Conversation

natebosch
Copy link
Member

See flutter/flutter#91432

Pull out a _currentInvoker utility to share the exception fallback
behavior between printOnFailure and markTestSkipped.

See flutter/flutter#91432

Pull out a `_currentInvoker` utility to share the exception fallback
behavior between `printOnFailure` and `markTestSkipped`.
@natebosch natebosch merged commit 2a062cf into master Oct 13, 2021
@natebosch natebosch deleted the mark-skipped-message branch October 13, 2021 20:26
}

/// Marks the current test as skipped.
///
/// A skipped test may still fail if any exception is thrown, including uncaught
/// asynchronous errors. If the entire test should be skipped `return` from the
/// test body after marking it as skipped.
void markTestSkipped(String message) => Invoker.current!.skip(message);
void markTestSkipped(String message) => _currentInvoker..skip(message);
Copy link
Member

@lrhn lrhn Oct 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single cascade should just be .?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants