-
Notifications
You must be signed in to change notification settings - Fork 30
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
[PoC] Adding Cypress tests code coverage #3633
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Steps to Generate a Unified Coverage Report
|
Summary
Here is a PoC where we try to setup a code coverage report out of the e2e tests we run on the Playground application.
Description
We basically need to:
When we run the instrumented application we will see a
window.__coverage__
object in the browser which contains data and helpers which Cypress e2e support plugin will use in order to gather information.Cypress will generate a low level report in the
<repo_root>/.nyc_output/out.json
file and we can use it to generate a human readable report.These would be the steps:
pnpm build
ENABLE_EXPERIMENTAL_VITE_BUNDLER
env variable set to'false'
in the/playground/.env
file)pnpm playground:build
pnpm playground:start:prod:local
/cypress/.env.template
file)npx cypress open
npx nyc report
(from the root folder of the repo)This is meant to play with the configuration and make sure we can apply it to every MC application and get a report we can trust.
Important Currently the coverage report does not include info for the page components of playground. It seems it just reads the
index.js
file of those components which are just alazy
export of the actual ones.We need to investigate and have this sorted out before we can take this PoC as successful.
Also, the current implementation has been only tested when building the application with
webpack
. We need to test it withvite
as well.