{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/test/issues/395","repository_url":"https://api.github.com/repos/dart-lang/test","labels_url":"https://api.github.com/repos/dart-lang/test/issues/395/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/test/issues/395/comments","events_url":"https://api.github.com/repos/dart-lang/test/issues/395/events","html_url":"https://github.com/dart-lang/test/issues/395","id":132253687,"node_id":"MDU6SXNzdWUxMzIyNTM2ODc=","number":395,"title":"Add a matcher for an unwanted failure","user":{"login":"nex3","id":188,"node_id":"MDQ6VXNlcjE4OA==","avatar_url":"https://avatars0.githubusercontent.com/u/188?v=4","gravatar_id":"","url":"https://api.github.com/users/nex3","html_url":"https://github.com/nex3","followers_url":"https://api.github.com/users/nex3/followers","following_url":"https://api.github.com/users/nex3/following{/other_user}","gists_url":"https://api.github.com/users/nex3/gists{/gist_id}","starred_url":"https://api.github.com/users/nex3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nex3/subscriptions","organizations_url":"https://api.github.com/users/nex3/orgs","repos_url":"https://api.github.com/users/nex3/repos","events_url":"https://api.github.com/users/nex3/events{/privacy}","received_events_url":"https://api.github.com/users/nex3/received_events","type":"User","site_admin":false},"labels":[{"id":158821521,"node_id":"MDU6TGFiZWwxNTg4MjE1MjE=","url":"https://api.github.com/repos/dart-lang/test/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":180486935,"node_id":"MDU6TGFiZWwxODA0ODY5MzU=","url":"https://api.github.com/repos/dart-lang/test/labels/matcher","name":"matcher","color":"c7def8","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-02-08T20:52:37Z","updated_at":"2018-06-15T17:54:57Z","closed_at":"2018-06-15T17:54:57Z","author_association":"MEMBER","body":"This would allow users to mark a test as failing, while ensuring that the failure keeps occurring and continues to be in the expected form.\n\nThe signature should be something like `Matcher fails(matcher)`, where the argument is applied to the first error that's thrown. This would differ from `throwsA` in the following ways:\n- It would print a message indicating that the failure occurred, to remind the test author to fix it in the future.\n- If it's run against a function, it would run the function in an error zone and capture any out-of-band errors it throws as well.\n- It would use the internal `waitForOutstandingCallbacks()` infrastructure to block the test's completion until the function completed as a test case would.\n\nThis would allow users to effectively move an entire test case into an `expect()` call for this matcher. For example:\n\n``` dart\ntest(\"failing test\", () {\n  expect(() async {\n    // original test body\n  }, fails(isStateError));\n});\n```\n\nThis matcher would need to exist in `test` because of its asynchrony and interaction with `test`'s internal infrastructure.\n"},"comment":{"url":"https://api.github.com/repos/dart-lang/test/issues/comments/397697131","html_url":"https://github.com/dart-lang/test/issues/395#issuecomment-397697131","issue_url":"https://api.github.com/repos/dart-lang/test/issues/395","id":397697131,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzY5NzEzMQ==","user":{"login":"grouma","id":1840773,"node_id":"MDQ6VXNlcjE4NDA3NzM=","avatar_url":"https://avatars1.githubusercontent.com/u/1840773?v=4","gravatar_id":"","url":"https://api.github.com/users/grouma","html_url":"https://github.com/grouma","followers_url":"https://api.github.com/users/grouma/followers","following_url":"https://api.github.com/users/grouma/following{/other_user}","gists_url":"https://api.github.com/users/grouma/gists{/gist_id}","starred_url":"https://api.github.com/users/grouma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grouma/subscriptions","organizations_url":"https://api.github.com/users/grouma/orgs","repos_url":"https://api.github.com/users/grouma/repos","events_url":"https://api.github.com/users/grouma/events{/privacy}","received_events_url":"https://api.github.com/users/grouma/received_events","type":"User","site_admin":false},"created_at":"2018-06-15T17:54:57Z","updated_at":"2018-06-15T17:54:57Z","author_association":"MEMBER","body":"throwsA should handle this use case. "}}
{"actor":{"display_login":"grouma"}}