Skip to content

feat(ui): add coverage#2364

Closed
userquin wants to merge 12 commits intomainfrom
userquin/feat-ui-coverage
Closed

feat(ui): add coverage#2364
userquin wants to merge 12 commits intomainfrom
userquin/feat-ui-coverage

Conversation

@userquin
Copy link
Member

@userquin userquin commented Nov 22, 2022

This PR adds the coverage folder in a new iframe inside Coverage component:

  • coverage css files not being served
  • vite tranforms coverage html pages, I need to find a way to exclude them
  • fix coverage error (check the screenshot below): I guess the error comes when Vite injects @vite/client script

To test the coverage run pnpm run build && pnpm run test from root folder and from another shell run cd packages/ui && nr dev:ui.

/cc @edimitchel : from your comment here #493 (comment)

closes #2336

imagen

@userquin
Copy link
Member Author

It is working but only with bundled ui, using it on dev I cannot make it working (css not being loaded):

  • pnpm run install && pnpm run build from root
  • cd test/core && pnpm vitest --ui

We also need to disable coverage button while running and adding small delay once tests run finish.

The css styles using istambul in dark mode needs a review: https://streamable.com/8jsoac

@userquin
Copy link
Member Author

Lastest changes: https://streamable.com/3ek8l0

@userquin userquin marked this pull request as ready for review November 22, 2022 20:05
@userquin
Copy link
Member Author

userquin commented Nov 22, 2022

I need to add another script to enable coverage, rn enabled in tests/core.

We also need to check pnpm.override in root package.json, update esbuild version.

@edimitchel
Copy link
Member

I wondering, won't you able to reuse raw data and attach coverage information to each test suite and show the coverage on suite/test items list, and details put in a test details tab?

@userquin userquin marked this pull request as draft November 23, 2022 11:11
@userquin
Copy link
Member Author

I wondering, won't you able to reuse raw data and attach coverage information to each test suite and show the coverage on suite/test items list, and details put in a test details tab?

Yeah, I'll work next weekend on this - current state was simple, just adding a middleware and some client stuff, your proposal requires a bit more work

@sheremet-va sheremet-va deleted the userquin/feat-ui-coverage branch March 29, 2023 13:36
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.

Coverage viewer in Vitest UI

3 participants