jwt
jwt copied to clipboard
Tests: Consider using testify require/assert for tests
The package has a policy of not depending on third party packages and consuming only the standard library but for well structured tests we could benefit from using a more sophisticated package like https://github.com/stretchr/testify, simplifying the test code and hardening the assertions
By well structured tests, I mean tests that are in their explicit test packages, thus not being linked on build time to the non-test code (that is, is foo_test
being the test package given the package foo
)
PS: Just to clarify the previous: this means still adhering to the policy of not adding (or avoiding it to a great extent) third party packages to main runtime code, just to test code paths
This gets a minus one from me. Unlike say a large application with complex assertions, this package is fairly simple and lightweight.
I personally also don't like how bloated the stretchr/testify API is. I'd be open for a more lightweight assertion package, just not testify.
I personally also don't like how bloated the stretchr/testify API is. I'd be open for a more lightweight assertion package, just not testify.
Fair enough, I can take a look at the alternatives and come back (and also, in the meanwhile, see if anyone else comments their opinion here on the matter)
~One alternative I've used in another project: https://github.com/matryer/is~ I do not recommend this package anymore.
But I still think we can avoid assertion packages because this is a fairly small package and a few if err != nil
checks don't hurt ;)
I suggest closing the issue for now.