Consider a function that does some exception handling based on the arguments passed:
List range(start, stop) {
i
An exception is checked using throwsA with TypeMatcher.
Note: isInstanceOf is now deprecated.
List range(start, stop) {
if (start >= stop) {
throw new ArgumentError("start must be less than stop");
}
// remainder of function
}
test("check argument error", () {
expect(() => range(1, 2), throwsA(TypeMatcher()));
});