Skip to content

Commit fc6e49f

Browse files
committed
#124: check error in tests
1 parent 8d5eefd commit fc6e49f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/writer/model_reader_test.dart

+12
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ TestModel:
8989
}
9090

9191
expect(error, isNotNull);
92+
expect(error, isArgumentError);
93+
if (error is ArgumentError) {
94+
expect(error.message, 'required is removed, follow the migration to version 7.0.0');
95+
}
9296
});
9397

9498
test('Test List not supported anymore', () {
@@ -111,6 +115,10 @@ TestModel:
111115
error = e;
112116
}
113117
expect(error, isNotNull);
118+
expect(error, isException);
119+
if (error is Exception) {
120+
expect(error.toString(), 'Exception: Could not generate all models. `array` is not added to the config file');
121+
}
114122
});
115123

116124
test('Test Map not supported anymore', () {
@@ -134,6 +142,10 @@ TestModel:
134142
error = e;
135143
}
136144
expect(error, isNotNull);
145+
expect(error, isException);
146+
if (error is Exception) {
147+
expect(error.toString(), 'Exception: Could not generate all models. `map` is not added to the config file');
148+
}
137149
});
138150

139151
test('Test simple generic fields', () {

0 commit comments

Comments
 (0)