Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add unit tests for completion models #1572
Current coverage is 82.21%
@@ master #1572 diff @@ ========================================== Files 106 106 Lines 15371 15374 +3 Methods 0 0 Messages 0 0 Branches 2462 2463 +1 ========================================== + Hits 12523 12640 +117 + Misses 2378 2260 -118 - Partials 470 474 +4
Nice work overall!
As mentioned in the line comments I'm somewhat wary about all the mocking though. It's always a trade-off, as it increases test maintainance costs for future changes and also opens the possibility of tests passing but the real code failing because of a discrepancy there.
While it makes sense to mock bigger things off which you can't easily instantiate (say, a
Could you take another look at what actually makes sense to mock out, and where it'd be simpler to use the real thing?
PR: work in progress
PR: needs final review/merge
Jun 30, 2016
Definitely. It depends on whether you really think of these 'unit' tests as 'isolation' tests, or whether they could have some elements of an integration test. I was leaning towards the former, but it definitely feels like I mocked out too much.
In particular, it might make sense to use a real
Yeah, I'm usually leaning a bit more towards the latter.
I think the benefit is clear: More straightforward and often more maintainable tests.
The drawbacks I can think of:
I'm pretty much in complete agreement about mocking. I've seen tests that mock out so much they don't even seem to be testing anything ...
I managed to eliminate the fake setting sections and values; I kept around
I remember now why I didn't use a real
I've got a test for the