this is my funckion using package testing, gorm and sql-mock: I don't understand why I have an error creating a unit test as in the example below, ...
this is my funckion using package testing, gorm and sql-mock: I don't understand why I have an error creating a unit test as in the example below, ...
I have a Gorm delete with the returning result: Now the test with clauses always fails. e.g. : Receiving error: "call to Query 'DELETE FROM "my ...
I am looking to mock up this query in my code ("select max(a) from public.abc where id = %d") The way I am mocking this line is And I am seeing th ...
I am having problems comparing the query expected with the true query of gorm, this is my code: here is the module domain: and here the function ...
I am struggling with writing a test for my go lambda function with sqlmock and gorm. This is the function I want to test: And this is my test: ...
I am trying to unit test my go code using sqlmock. Here is the original code that I am trying to test. Here is my unit test I am expecting fmt.P ...
I am trying to test my DB functions using go-sqlmock and I am not able make this one test pass. Here is my model Here is my DB function I have ...
I have this code in my application, I use goroutine because that queries are very slow. The code works correctly but I've been trying to test that fun ...
I have this repository Which does a Soft-Delete, the query which this Delete operation runs is this one UPDATE "workspaces" SET "deleted_at"='2 ...
I am trying to wrote this test bellow, other tests works fine, however I am having problems with the UPDATE query repository.Delete does this query ...
whenever I am trying to mock an expected "return err" of gorm , it is still considered as unit testing FAIL status even if I added require.Error becau ...
I am using go-sqlmock for the first time and I am trying to write a test for post operation. I am using gorm and gin. The test is giving me an err ...
I'm using sqlmock to unit test a set of Mysql database query handlers written in Go. This works great for standard SELECT / INSERT queries. For our db ...
Summary I'm trying to use go-sqlmock with gorm for testing. I want to write a test for the initial database migration, but I've hit a panic: runtime ...
When unit testing I mock gorm using sqlmock. But when running all initial setup are fine but error happen when the actual query and testing query matc ...
I'm trying to do a simple unit test using go-sqlmock to do a select and return a mapped ID. Code snippet below s.sqlmock.ExpectBegin() s.sqlm ...
I have two Go test cases as shown below that test a gRPC function called MyEndpoint. MyEndpoint is supposed to succeed when the database row it selec ...
When I try to mock a Postgres insert with SQLMock and Gorm.io I receive an error that the query isn't expected. I tried to use regexp.QuoteMeta() to w ...
I have a use case in one of my Golang applications to update multiple tables in an API and in case one of the updates fails, I would want all the prev ...
sqlmock needs to match the SQL in order. But if I have concurrent query in my code just like this: condition1 := make(map[string]string) cond ...