Replies: 1 comment
-
In general, some sort of solution to #70713 would be huge for larger companies deciding to use API routes or request-time, server-side Next.js in App router apps. We have no ability to generate coverage reports for that code! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
No response
Background
While trying to collect coverage there are well documented ways to do this in Playwright or Cypress for code executed on the client. Using a tool like
nyc
we can runnyc next dev
and this will collect coverage from the server. However for SSR code there appears to be no coverage.Let's say we have a page like
src/pages/home/index.html
. If we don't visit home in a test we get no coverage for that page with nyc. If we do visit it, all the top level statements are shown as covered, but not inside the functions like the page component orgetStaticProps
.Proposal
I imagine the next server renders the page in a separate process. It would be great if there was an integration with nyc so that coverage is still collected for server side page renders.
Beta Was this translation helpful? Give feedback.
All reactions