diff --git a/json_serializable_e2e_test/test/json_serialization_and_deserialization_test.dart b/json_serializable_e2e_test/test/json_serialization_and_deserialization_test.dart index d96927d..554ba7d 100644 --- a/json_serializable_e2e_test/test/json_serialization_and_deserialization_test.dart +++ b/json_serializable_e2e_test/test/json_serialization_and_deserialization_test.dart @@ -36,11 +36,19 @@ void main() { test('can deserialize IList of enums', () { expect(IListWrapper2.fromJson({'iList': []}).iList, IList([])); - expect( - IListWrapper2.fromJson({ - 'iList': [TestEnum.valA, TestEnum.valB, TestEnum.valC] - }).iList, - IList([TestEnum.valA, TestEnum.valB, TestEnum.valC])); + + IList result; + try { + result = IListWrapper2.fromJson({ + 'iList': ['valA', 'valB', 'valC'] + }).iList; + } catch (e) { + result = IListWrapper2.fromJson({ + 'iList': [TestEnum.valA, TestEnum.valB, TestEnum.valC] + }).iList; + } + + expect(result, IList([TestEnum.valA, TestEnum.valB, TestEnum.valC])); }); });