Replies: 1 comment 2 replies
-
You could run tests with sqllite which is a similar setup as you have now. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Recently our team has been using https://github.com/imanghafoori1/eloquent-mockery to mock database calls to improve test runtime as well as to isolate testing to business logic.
However this library is very small, with limited support, and just underwent a major refactor that broke some of our tests.
Looking the laravel docs for database testing https://laravel.com/docs/master/database-testing, it looks like we can create test records but we cannot mock the eloquent calls.
Without using this approach yet it seems like this would run a lot slower in our pipeline but it would be a good solution moving forward.
Has anyone been able to mock database calls for the query builder or Eloquent ORM calls? If so is there documentation on this?
If not is is best to just use the actual database with test records?
Beta Was this translation helpful? Give feedback.
All reactions