Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose a method to override rendering of the final generated image #165

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thomas-stockx
Copy link

We prefer the golden_toolkit methodology of setting up golden tests above other packages currently available.
However, probably the number one issue at this point is consistent UI tests across platforms. Even with the Ahem font, these squares do not render consistently accross platforms, due to issues with font smoothing, text scaling differences, etc.
Other packages (such as alchemist) have workarounds for this, like replacing all rendered paragraphs with rendered rectangles instead.

To allow us the best of both worlds, I exposed a new function in the configuration for golden_toolkit which allows providing a method which will run right before the golden tests are generated. This allows developers to (for example) hook-in the rectangle rendering for fonts of the alchemist package (https://github.com/Betterment/alchemist/blob/main/lib/src/blocked_text_image.dart) which will generate consistent golden tests across all platforms, or do more advanced stuff.

@mZadorskii
Copy link
Contributor

@thomas-stockx Thanks for contribution!
Can you add a test with golden that is leveraging new functionality?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants