Continuing from yesterday question, how would I test that a async method throws an exception.
main(){
test( "test2", () async {
expect( await throws(), throwsException);
});
}
Future throws () async {
throw new FormatException("hello");
}
This way it works:
Basically just remove
await. The test framework can deal with futures no matter if they succeed or fail.