Expectations not working properly with subtests #1620
Unanswered
bartolek153
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi. I'm trying to create some unit tests combining
assert
andmock
packages, but I'm encountering an error that I suspect it may be due to a incorrect setup in the sample test code below:And this is what
MockUsersRepository
look like:The first subtest passes normally, second and third fail however. They tell me
err
variable is nil and is expected to returnErrDatabaseFailed
.Am I missing some setup in the MockUsersRepository type or in the test code since I'm using a unique mock instance to all subtests?
Beta Was this translation helpful? Give feedback.
All reactions