dart test expect assert fail 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>());
});
}
import 'package:test/test.dart';
void main() {
test('assert throws assert', () {
expect(() {
assert(false);
}, throwsA(isA<AssertionError>());
});
}