dart test throwsA assertionerror code example
Example: dart test expect assert fail
import 'package:test/test.dart';
void main() {
test('assert throws assert', () {
expect(() {
assert(false);
}, throwsA(isA<AssertionError>());
});
}