Replies: 3 comments 1 reply
-
A possible solution would be to use Diesel's Connection::test_transaction to prevent changes to the database when running tests. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Additional possible solution would be to use docker to create a throwaway test database to use and then destroy after running the integration tests. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Additional possible solution would be to use sqlite3 for testing only. We could create the db, run migrations and then cleanup the db once testing is done. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Research discussion to document findings for mocking Diesel ORM to enable unit testing of API endpoints.
Currently, we are not aware of a good way to mock a database connection in Diesel similar to something you would do in unit tests in other languages.
Beta Was this translation helpful? Give feedback.
All reactions