Output comparison testing
projhect opened this issue · 2 comments
Hello!
I would like to propose that “output comparison” testing (aka snapshot testing) be discussed.
At its minimum, it would only require for write
and ioctl
functions to be customizable via internal setters or a new Application.init
.
Another option would be enabling the injection of a custom Renderer (either using a protocol or subclassing the existing one). Size would need to be customizable too.
@rensbreur have you thought about this already?
Hi, I'm open for concrete suggestions. I don't think snapshot testing should be part of SwiftTUI, but if another framework can be supported without requiring big changes in how SwiftTUI works I'd be open to help out.
At its minimum, it would only require for write and ioctl functions to be customizable via internal setters or a new Application.init.
Another option would be enabling the injection of a custom Renderer (either using a protocol or subclassing the existing one). Size would need to be customizable too.
I'm not sure it's that easy to get snapshot tests to work like this, because of things like escape sequences used to redraw specific parts of the screen. Working with layers and controls might be easier but I'm not sure.
I'll close this for now until we have more concrete plans.