Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Related Rants
I just reviewed a pull request with a test case like (pseudo code):
# Test MyService
const mock = createMock(myService.myMethod)
.whenCalledWith("foo")
.returns("bar");
assert(mock.myMethod("foo") === "bar"));
Why though? Why are we testing the mock? What is happening here? This test has no reason of being there instead of a fuzzy feeling that we now have unit test to lure us into a false sense of security.
I asked why we don't do an integration test. Response was: "They are slow."
Well, duh, but at least they would actually test something.
What do you gain by asserting that the mock is working the way you set it up?
rant
testing the mocks
this is not how tests should look like
tdd
integration tests
mock
unit tests