Closed jpolack closed 3 years ago
Thanks for your Feedback!
I am wondering why coveralls does not track that last line. I checked it locally and this test case should cover the missing line: https://github.com/corbym/gocrest/pull/1/files#diff-1a13e117c42f75f290b07b9587f7401c2f91a32980298f6e0bc547de98865e51R817 🤔
Is there a possiblity to call coveralls locally? go test ./... -cover
just gives me the coverage for the gocrest
package but not the subpackages.
One thing I want to get mentioned: With these matchers one can write quite complex assertions. And the way we currently describe the errors might be too long, because atm we would print all assertions, even the ones that succeded. A future improvement could be to change that and just print the assertions that failed (maybe with a property path) and the actual value (maybe as a stack)
Thanks for your Feedback!
I am wondering why coveralls does not track that last line. I checked it locally and this test case should cover the missing line: https://github.com/corbym/gocrest/pull/1/files#diff-1a13e117c42f75f290b07b9587f7401c2f91a32980298f6e0bc547de98865e51R817 🤔
Is there a possiblity to call coveralls locally?
go test ./... -cover
just gives me the coverage for thegocrest
package but not the subpackages.
I think coveralls is having a bit of a paddy. I will merge your code and then check out what is happening from there.
One thing I want to get mentioned: With these matchers one can write quite complex assertions. And the way we currently describe the errors might be too long, because atm we would print all assertions, even the ones that succeded. A future improvement could be to change that and just print the assertions that failed (maybe with a property path) and the actual value (maybe as a stack)
I have opened an issue for this. It will be esp. useful when allOf and anyOf or the variadic parametered matchers are called.
Thanks for your Feedback!
I am wondering why coveralls does not track that last line. I checked it locally and this test case should cover the missing line: https://github.com/corbym/gocrest/pull/1/files#diff-1a13e117c42f75f290b07b9587f7401c2f91a32980298f6e0bc547de98865e51R817 🤔
Is there a possiblity to call coveralls locally?
go test ./... -cover
just gives me the coverage for thegocrest
package but not the subpackages.
I found the reason for this: the test was assigning the actual string to an interface{} type and that was Panicking in the for loop rather than the default method.
This has been fixed.
I implemented two new matchers:
has.ElementsWith
: Checks wether each element of an array/slice matches all expectationshas.StructWithValues
: Allows to check single struct fieldsCan be combined in a way that now we can check if f.e.:
has structs that have an
id
field with the prefixsomeId