-
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api) refactor api for ergonomics and type safety (#703)
* feat(api) refactor api for ergonomics and type safety Signed-off-by: Dan Selman <[email protected]> * regen types Signed-off-by: Dan Selman <[email protected]> * wip Signed-off-by: Matt Roberts <[email protected]> * test: fix tests for concerto-core Signed-off-by: Dan Selman <[email protected]> * test: fix tests Signed-off-by: Dan Selman <[email protected]> * test: fix tests Signed-off-by: Dan Selman <[email protected]> * fix: tests Signed-off-by: Dan Selman <[email protected]> * chore: reduce code cov Signed-off-by: Dan Selman <[email protected]> * chore: code cov Signed-off-by: Dan Selman <[email protected]> --------- Signed-off-by: Dan Selman <[email protected]> Signed-off-by: Matt Roberts <[email protected]> Co-authored-by: Matt Roberts <[email protected]>
- Loading branch information
Showing
64 changed files
with
988 additions
and
2,058 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,13 @@ import { getDeclarationType, getPropertyType, getValidatorType } from '../../src | |
|
||
const modelManager = new ModelManager(); | ||
const propertyAst = { | ||
$class: '[email protected]', | ||
name: 'myProp', | ||
type: 'Boolean' | ||
}; | ||
const modelAst = { | ||
$class: '[email protected]', | ||
name: 'Unknown', | ||
namespace: '[email protected]', | ||
properties: [] | ||
}; | ||
|
@@ -19,7 +22,7 @@ const field = new Field(classDeclaration, propertyAst); | |
const validator = new Validator(field, {}); | ||
|
||
test('should throw for unknown class declaration type', () => { | ||
expect(() => getDeclarationType(classDeclaration)).toThrow('unknown class declaration type "ClassDeclaration {[email protected].undefined super=Concept enum=false abstract=false}"'); | ||
expect(() => getDeclarationType(classDeclaration)).toThrow('unknown class declaration type "ClassDeclaration {[email protected].Unknown super=Concept declarationKind=UnknownDeclaration abstract=false idField=null}"'); | ||
}); | ||
|
||
test('should throw for unknown thing', () => { | ||
|
@@ -28,7 +31,7 @@ test('should throw for unknown thing', () => { | |
}); | ||
|
||
test('should throw for unknown class property type', () => { | ||
expect(() => getPropertyType(property)).toThrow('unknown property type "[object Object]'); | ||
expect(() => getPropertyType(property)).toThrow('unknown property type "BooleanProperty {[email protected]}"'); | ||
}); | ||
|
||
test('should throw for unknown validator type', () => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.