-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(infrastructure): setup mock db env #6
Conversation
b4d02b4
to
80023db
Compare
80023db
to
50cf682
Compare
Coverage Report
File CoverageNo changed files found. |
func HandleDashboardUserPostLogin(w http.ResponseWriter, r *http.Request) { | ||
firebaseId := r.Context().Value(constants.FireBaseIdContextKey).(string) | ||
|
||
if userExists, queryErr := db.GetQueries().CheckUserExists(r.Context(), firebaseId); queryErr != nil { | ||
log.Error().Err(queryErr).Msg("failed to retrieve user") | ||
dbQueries := db.GetQueries() |
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 get the other 2 funcs, what about mocking dbQueries for this guy
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 was wrong, db.Queries is actually a struct - not an interface. We cannot mock it.
What we can do is add an abstraction layer, and then mock it. But I think this is an overkill for now.
7c3f579
to
15a6adf
Compare
15a6adf
to
8f6d3ed
Compare
No description provided.