-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validation Tests #359
Validation Tests #359
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a first comment, consider using lower-case letters for the input / output ports of transforms. That way the test models follow the naming convention established by the electric-vehicles.jv
example.
I have one question:
as input for the valuetype-definition test that tests
the test never "throws" the error as expected. The reason for that is, that during the type-inference of the collection values expression?.value?.ref (more precise ref ) in inferTypeFromReferenceLiteral is undefined, which from my understanding can either mean that linking has not been done, or the linking failed.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, well done!
libs/language-server/src/lib/validation/checks/expression-constraint-definition.spec.ts
Outdated
Show resolved
Hide resolved
expect(validationAcceptorMock).toHaveBeenCalledTimes(2); | ||
expect(validationAcceptorMock).toHaveBeenCalledWith( | ||
'error', | ||
`The pipelinedefinition name "Pipeline" needs to be unique.`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you actually found a bug here. It message is supposed to state The pipeline name "Pipeline" needs to be unique
.
Same for transforms, valuetypes and constraints.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to directly fix the bug? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@georg-schwarz not sure if you mean me, but if yes I would do that in a separate PR and create an issue for that 😄
libs/language-server/src/lib/validation/checks/property-assignment.spec.ts
Outdated
Show resolved
Hide resolved
libs/language-server/src/lib/validation/checks/valuetype-definition.spec.ts
Outdated
Show resolved
Hide resolved
The linking is done during the creation of the |
Co-authored-by: Felix Quast <51856713+felix-oq@users.noreply.github.com>
I understand, forgot to check whether the grammar considers this valid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure to follow the jest naming pattern for consistency. I added one example.
describe
should always point to the subject under test (the class or broader functionality). It is a test file, so no need to mention it is a test.
it
should always start with a "should" defining the expected behavior, potentially followed by a "when" later to distinguish different preconditions.
libs/language-server/src/lib/validation/checks/expression-constraint-definition.spec.ts
Outdated
Show resolved
Hide resolved
libs/language-server/src/lib/validation/checks/expression-constraint-definition.spec.ts
Outdated
Show resolved
Hide resolved
libs/language-server/src/lib/validation/checks/expression-constraint-definition.spec.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it, well done!
This adds the missing validation tests for