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 renderToImage for library user's own tests #2843

Open
adam1658 opened this issue Aug 14, 2024 · 0 comments
Open

Expose renderToImage for library user's own tests #2843

adam1658 opened this issue Aug 14, 2024 · 0 comments

Comments

@adam1658
Copy link

Is your feature request related to a problem? Please describe.
I'd like to snapshot test my own PDFs that are generated with react-pdf. I note that the library already uses snapshot testing with vitest and jest-image-snapshot internally, and this would be a good solution for my own project that consumes react-pdf

Describe the solution you'd like
Include https://github.com/diegomura/react-pdf/blob/3f5bf67d84ee784b6685cf603f04ac5f568a146d/packages/renderer/tests/renderComponent.js#L116-L117 as an export of the library

Describe alternatives you've considered
Reimplement this functionality in my own vitest tests - very doable but it'd be convenient to keep that complexity in react-pdf where it's already used and tested

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

No branches or pull requests

1 participant