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

feature: adds javascript coverage information for storycap crawls #602

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

saranrapjs
Copy link

This branch introduces support for emitting coverage information as collected by Puppeteer workers. I've taken some liberties with how this is supported in the CLI, the main requirement being that the v8-to-istanbul library requires an actual path on disk to the covered code in order to work.

Otherwise this code should be relatively straightforward, mostly making use of existing puppeteer API's (albeit in a way that required upgrading the puppeteer dependency; i'm not sure off hand if there are breaking changes that would necessitate a breaking change for this library) and existing node modules for interoperating with puppeteer/istanbul coverage data.

This branch doesn't yet have any tests, end to end, or otherwise...very open to adding anything else here, depending on what seems needed!

TODO:

  • In one yarn-based monorepo I've tested with, Storybook's webpack will include sourcemaps and coverage information for non-relative path files as if they were in the same directory as the main source code described by --coverage. Not clear yet if this is an issue with storybook/webpack, or the nyc/istanbul toolchain, or something else...it might be an edge case to support storybook coverage for monorepo-symlinked sibling modules!

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

Successfully merging this pull request may close these issues.

1 participant