Fix text_style_text.dart to be Dart 2 compliant. (#14559)

In Dart 2 mode we throw different exception: compiler generates
throw of a compilation error instead of runtime throwing
noSuchMethod.
This commit is contained in:
Vyacheslav Egorov 2018-02-08 22:10:31 +01:00 committed by GitHub
parent 7982694a0c
commit 90ddb2370b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,7 @@ void main() {
fontWeight: FontWeight.w800,
height: 123.0,
);
expect(() { s1.fontFamily = 'test'; }, throwsA(isNoSuchMethodError)); // ignore: ASSIGNMENT_TO_FINAL
expect(() { s1.fontFamily = 'test'; }, throwsA(const isInstanceOf<Error>())); // ignore: ASSIGNMENT_TO_FINAL
expect(s1.fontFamily, isNull);
expect(s1.fontSize, 10.0);
expect(s1.fontWeight, FontWeight.w800);