gumil07/18/2020, 11:04 AM
in production code? I rarely see it being used and only seen it used in tests. I wanted to know people's opinion if they ever used this function.
dekans07/18/2020, 12:31 PM
gumil07/18/2020, 12:36 PM
it only emits the last value without the yield.
Zach Klippenstein (he/him) [MOD]07/19/2020, 10:12 PM
call fixes something and you’re not sure why, it’s dangerous to rely on that without figuring out what’s really going on. Adding it to production code in to make your tests work is definitely something I would consider a smell. In your example, it sounds like you’re trying to observe intermediate values in a sequence of state transitions, which is an odd thing to test since your production code is probably just as likely to not observe intermediate values.
gumil07/19/2020, 10:38 PM