#124 make type detector smarter#138
Conversation
vanlooverenkoen
left a comment
There was a problem hiding this comment.
Write tests to check that the old implementation is not possible anymore.
| @@ -1,7 +1,10 @@ | |||
| # Changelog | |||
| ## [6.4.0] - 2023-08-14 | |||
There was a problem hiding this comment.
Breaking change should be 7.0.0
| roles: List<string> | ||
| customProperties: Map<String, Property>? | ||
| ``` | ||
| since 6.4.0 inline types are supported now even when adding extra configuration: |
There was a problem hiding this comment.
Update version & the rest of this readme as well. So the readme matches the latest version
| non_final: true | ||
| dateChange: | ||
| type: datetime | ||
| type: datetime? |
There was a problem hiding this comment.
Maybe better to already switch everything to String & DateTime instead of lowercase?
| expect(simpleDateTime.isRequired, false); | ||
| }); | ||
|
|
||
| test('Test required not definable anymore', () { |
There was a problem hiding this comment.
Also add tests for list & map with the correct config.
And also add test for the old config. -> that should expect an exception
|
Fix readme |
| Field getField(String name, YamlMap property, | ||
| {required bool disallowNullForDefaults}) { | ||
| try { | ||
| final required = |
There was a problem hiding this comment.
Maybe for this release do it llike this.
if( property.containsKey('required')){
throw ArgumentError('required is removed, follow the migration to version 7.0.0);
}
| expect(requiredString1.type, isA<StringType>()); | ||
| expect(requiredString1.isRequired, true); | ||
|
|
||
| expect(optionalString2.type, isA<StringType>()); |
There was a problem hiding this comment.
use same formatting as your TestModel
| error = e; | ||
| } | ||
|
|
||
| expect(error, isNotNull); |
There was a problem hiding this comment.
check if the error is in fact related to the required:true so check the actual error not just isNotNull
| } catch (e) { | ||
| error = e; | ||
| } | ||
| expect(error, isNotNull); |
There was a problem hiding this comment.
check the actual error
| } catch (e) { | ||
| error = e; | ||
| } | ||
| expect(error, isNotNull); |
There was a problem hiding this comment.
check the actual error
closes #124