You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my flutter tests, I am wanting to be able to assert that a TypeError was thrown. To do this, I have to do something like:
test('fromJson throws TypeError when "key" is of type Map instead of String', () {
expect(
() =>Object.fromJson({
'key': {},
}),
throwsA(isA<TypeError>()),
);
});
The above test should also be able to be written as so:
test('fromJson throws TypeError when "key" is of type Map instead of String', () {
expect(
() =>Object.fromJson({
'key': {},
}),
throwsTypeError),
);
});
Similar matchers are already supported, as seen here.
The text was updated successfully, but these errors were encountered:
In my flutter tests, I am wanting to be able to assert that a
TypeError
was thrown. To do this, I have to do something like:The above test should also be able to be written as so:
Similar matchers are already supported, as seen here.
The text was updated successfully, but these errors were encountered: