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
We currently have a database connection setup for the production database in db/config.go, the config.go file has the initDB function which connects to the Database, and migrates the database tables schemas.
Design
We want to create a new file in the db folder test_config.go which will connect to the test DB and migrate the table schemas for the test DB.
Create a new global variable TestDB in test_config.go with the type of database, and set TestDB.db to the Test Database connection, the db.TestDB will be used to replace the mocked databases in the test handlers.
Acceptance Criteria
I've tested on Chrome
I've created a test that...
I have rebased and tested locally before submitting my PR
I can submit a PR within 1 day of taking the bounty
Context
We currently have a database connection setup for the production database in
db/config.go
, the config.go file has theinitDB
function which connects to the Database, and migrates the database tables schemas.Design
We want to create a new file in the db folder
test_config.go
which will connect to the test DB and migrate the table schemas for the test DB.Create a new global variable
TestDB
intest_config.go
with the type ofdatabase
, and setTestDB.db
to the Test Database connection, thedb.TestDB
will be used to replace the mocked databases in the test handlers.Acceptance Criteria
Here is an example backend test
The text was updated successfully, but these errors were encountered: