Closed tommy-mitchell closed 2 years ago
It doesn't really make sense to me that it's matching the whole doc comment. That would make the assertion huge. I think something like expectDocumentationCommentToContain()
would be more practical. So you can assert that the doc comment contains a certain substring.
I agree, I wanted to see what your thoughts were before making the match non-exact. I went with expectDocCommentIncludes
since it's less verbose and matches string.includes()
.
Can you fix the merge conflict?
Merged.
Adds an assertion to check the documentation comment of a given expression:
Fails if the type parameter does not exist, is not a string literal, or does not match the given expression's doc comment.
In one project, I have a function that takes a set of user-defined extension functions and maps them onto the built-ins.
expectDocComment
can help ensure that the type hinting for the user-defined extensions are mapped correctly.