You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe what should be investigated or refactored
Usually when testing a large output like on zarf dev find-images we only check a few strings such as require.contains("string-we-hope-to-find"), however this comes with some disadvantages. That string could appear more than once when we don't want it to, we could also get extra output we don't expect and aren't testing.
One solution we've tried is to create a text file of what we are looking for and ensure standard output contains the contents of the text file. This can be a brittle approach though and when something changes it can be hard to know exactly what changed.
In other languages I've used the approval tests framework https://github.com/approvals/go-approval-tests, which helped this process be more convenient, though in go it doesn't seem very popular or maintained. I do know the creator of approval tests, so I could pair with him to update the package if we wanted to
The text was updated successfully, but these errors were encountered:
Describe what should be investigated or refactored
Usually when testing a large output like on
zarf dev find-images
we only check a few strings such asrequire.contains("string-we-hope-to-find")
, however this comes with some disadvantages. That string could appear more than once when we don't want it to, we could also get extra output we don't expect and aren't testing.One solution we've tried is to create a text file of what we are looking for and ensure standard output contains the contents of the text file. This can be a brittle approach though and when something changes it can be hard to know exactly what changed.
In other languages I've used the approval tests framework https://github.com/approvals/go-approval-tests, which helped this process be more convenient, though in go it doesn't seem very popular or maintained. I do know the creator of approval tests, so I could pair with him to update the package if we wanted to
The text was updated successfully, but these errors were encountered: