Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This proposal adds E2E tests. It runs these tests on Node.js 18, 20, and 21 (so just like unit tests), in CJS and ESM mode.
Each test creates a stupid simple PDF and compares it to a reference PDF file stored inside the repository. It's purposefully minimal: the aim of these E2E tests is to catch any bugs that would break module resolution on different Node.js environments, rather than test advanced react-pdf rendering features, which is beautifully done in unit tests already.
Would have prevented #2602, #2608. Here's what happens if I remove
interop: 'compat'
bit added in #2605 from @react-pdf/renderer's Rollup config:⬆️ ESM is fine. But it was never broken in the first place.
⬆️ Whooops there we go! Caught CJS setup error.
Will prevent any future issues with module resolution caused by e.g. dependency updates or Rollup config updates.
Closes #2611
PS. I'm considering another E2E test that would spin up Vite-based front-end application, open it in the browser using Playwright and do a similar comparison, although that's a bit too much work for me at the moment.