diff --git a/test/core/definitions_test.dart b/test/core/definitions_test.dart index e1db1f00..3327cec6 100644 --- a/test/core/definitions_test.dart +++ b/test/core/definitions_test.dart @@ -660,4 +660,22 @@ void main() { throwsA(isA()), ); }); + + test("Should throw FormatExceptions for wrong array field types", () { + final invalidThingDescription = { + "@context": ["https://www.w3.org/2022/wot/td/v1.1"], + "title": "Thingweb WoT Thing", + "security": 42, + "securityDefinitions": { + "nosec_sc": { + "scheme": "nosec", + }, + }, + }; + + expect( + () => ThingDescription.fromJson(invalidThingDescription), + throwsA(isA()), + ); + }); }