Skip to content

Conversation

@Sriep
Copy link
Contributor

@Sriep Sriep commented Apr 19, 2021

Allows the state database to be mocked; this should make unit tests easier.
The postgres database is replaced with a sqlmock db, docks here..

Call var mockDB = MockTheStore() from your unit test, and use the mockDB to setupconstuct mock data for your test.

Addresses #81.

@Sriep Sriep mentioned this pull request Apr 19, 2021
@Sriep Sriep changed the title use sqlmock with gorm Use sqlmock with gorm for unit tests Apr 19, 2021
@Sriep Sriep changed the title Use sqlmock with gorm for unit tests [WIP] Use sqlmock with gorm for unit tests Apr 19, 2021
@Sriep Sriep changed the title [WIP] Use sqlmock with gorm for unit tests Use sqlmock with gorm for unit tests Apr 20, 2021
@Sriep Sriep requested a review from MurashovVen April 20, 2021 11:08
@Sriep Sriep merged commit eed333f into master Apr 20, 2021
@Sriep Sriep deleted the sqlmock branch April 20, 2021 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants