5 ms·
Along the way you might have some generic data transformation functions that require no notion of a request. They're just pure functions that transform data and
by turdnagel 8y ago
Along the way you might have some generic data transformation functions that require no notion of a request. They're just pure functions that transform data and can be easily unit tested. Seems nuts to mock a request just to test something like that.
- paxy 8y agoOr you could just pass the function an optional tracing ID as an argument.
- dvlsg 8y agoOr just keep logging / requests out of the pure functions, and leave it to the context around them. You can always have the pure functions return a `Result` or `Either` type, if you need information about a failure to be logged.
- sirbranedamuj 8y agoIf they don't require a notion of a request then don't pass it to them?