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

feat(reporters): summary option for verbose and default reporters #6893

Merged
merged 7 commits into from
Nov 18, 2024

Conversation

AriPerkkio
Copy link
Member

Description

Adds new summary: boolean option for verbose and default reporters. This option enables test summary that is shown below test results. This option is enabled by default. I would not consider this as breaking change, rather as bug fix for issues linked above.

import { defineConfig } from 'vitest/config'

export default defineConfig({
  test: {
    reporters: [
      ['verbose', { summary: true }],

      // or
      ['default', { summary: true }],
    ],
  },
})

Running Vitest's test/core tests - left one is main, right one is this PR:

vitest-reporter-before-and-after.webm

Most of the changes are related to listRenderer.ts removal. This is replaced with windowedRenderer.ts. After this PR we should do similar changes for dotRenderer and tableRenderer, and remove whole log-update from Vitest core.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Copy link

netlify bot commented Nov 11, 2024

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit a49a11b
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/673b28aa75ef970008bdab56
😎 Deploy Preview https://deploy-preview-6893--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

This comment was marked as outdated.

@AriPerkkio AriPerkkio force-pushed the feat/reporter-something-new branch 7 times, most recently from 5629c8f to 9f5803e Compare November 11, 2024 19:17
docs/guide/reporters.md Show resolved Hide resolved
docs/guide/reporters.md Outdated Show resolved Hide resolved
@AriPerkkio AriPerkkio force-pushed the feat/reporter-something-new branch 2 times, most recently from 0e315ff to 77e34b2 Compare November 12, 2024 09:49
@sheremet-va
Copy link
Member

sheremet-va commented Nov 13, 2024

Merged PR that affects the output: #6805 (it now prints a result.note message instead of [skip]) - this should probably only affect the output when there is only one test file running tests

@AriPerkkio AriPerkkio force-pushed the feat/reporter-something-new branch 3 times, most recently from b7a381c to db6ec84 Compare November 14, 2024 13:39
@AriPerkkio AriPerkkio marked this pull request as ready for review November 14, 2024 14:17
@AriPerkkio AriPerkkio force-pushed the feat/reporter-something-new branch from db6ec84 to 4509988 Compare November 14, 2024 14:54
Copy link
Contributor

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested in a few projects and it looks so good 👏

@AriPerkkio AriPerkkio force-pushed the feat/reporter-something-new branch 2 times, most recently from 33775b4 to a49a11b Compare November 18, 2024 11:44
@AriPerkkio AriPerkkio force-pushed the feat/reporter-something-new branch from a49a11b to 0592f39 Compare November 18, 2024 11:48
@sheremet-va sheremet-va merged commit 511b73c into vitest-dev:main Nov 18, 2024
18 checks passed
@AriPerkkio AriPerkkio deleted the feat/reporter-something-new branch November 18, 2024 14:10
@saitonakamura
Copy link
Contributor

saitonakamura commented Dec 2, 2024

Not sure if it's the best place to report it, but I think one thing was lost during the migration: reporting of retried tests. list renderer contained this line

suffix += c.yellow(` (retry x${task.result.retryCount})`)

it might be intentional though

@AriPerkkio
Copy link
Member Author

Good catch, thanks @saitonakamura. I created #7001 as follow-up. Looks like listRenderer had quite much untested logic inside it. 😬

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