You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to test that if the foo fails, the DB update passes correctly and I get an error from Bar() method.
However, if I don't specify mock.ExpectExec for the err = a.DB.UpdateError(id, "operation foo failed") line I get error all expectations were already fulfilled thrown by return "", fmt.Errorf("update err: %w", err) line. Considering that my test is correctly expecting error thrown by return "", fmt.Errorf("foo: %w", originalErr) line I get a false positive test pass.
Is it possible to configure sqlmock to not to throw error on performing unexpected query and then return error on mock.ExpectationsWereMet() call saying there was an unexpected query performed?