test(nextjs): Add sourcemaps test for nextjs turbopack#19647
test(nextjs): Add sourcemaps test for nextjs turbopack#19647
Conversation
size-limit report 📦
|
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
Co-Authored-By: Claude Opus 4.6 <[email protected]>
JPeer264
left a comment
There was a problem hiding this comment.
That is amazing, thanks for adding it. I wonder if we could spin this further and kinda don't have to write assert-build.ts at all and just reuse existing e2e-tests and allowlist them. So that we get the sourcemap upload check for free
The test is relatively cheap as we do not even need to spin up playwright for this, that's why I kept it standalone. Also we would need an intercepting mock server for every test – but I'm up for any improvements! |
|
Loving the mock API server, we need something similar for the bundler tests. Rather than have fixed assertions, we could make it more generic by passing the assertions to |
This is just an early spike on how we can test uploaded sourcemaps, I'd like to expand this a bit further in follow up PRs for different Next.js scenarios
Adds a new
nextjs-sourcemapse2e test app that verifies sourcemaps uploads duringnext buildThe test app builds a minimal Next.js app against a mock Sentry server, then asserts that:
Extracts the mock server and assertion logic into reusable utilities in
@sentry-internal/test-utils(startMockSentryServer,assertDebugIdPairs,assertSourcemapMappings, etc.) so other frameworks can reuse them.How it works
pnpm buildstarts a mock Sentry server on:3032, then runsnext buildwith@sentry/nextjsconfigured to upload sourcemaps to itpnpm test:assertrunsassert-build.tswhich loads the captured data and runs the assertion suiteCloses #19657 (added automatically)