Open chromy opened 7 years ago
I came to @natduca talking about this just yesterday, and the conclusion was that for the most part, we should see if we can solve these sorts of testing problems without mocking. Can you say more about your use case?
Great minds ;)
I have two objects A
and B
, I want to test A
. A
calls methods on B
and uses the results to construct some value objects. B
is a complicated thing in its own right which takes input and processes it to create the output that A
uses. Constructing B
in the test, while possible, will just obscure the details of B
that A
relies on while also making it possible to break the A
test while making changes to B
that don't effect A
.
Both A
and B
are POJsO which we control.
(In this case A
is tracing/tracing/extras/importer/heap_dump_trace_event_importer.html and B
is tracing/tracing/extras/importer/streaming_event_expander.html in this half written patch: https://codereview.chromium.org/2635023002/)
I am several yaks deep and would like a mocking framework for a test in tracing. I suggest http://sinonjs.org/ since it is actively maintained and has some documentation.