Skip to content

Comments

feat(vitest): show slow test duration in verbose reporter on CI#4929

Merged
sheremet-va merged 2 commits intovitest-dev:mainfrom
hi-ogawa:feat-ci-verbose-reporter-duration
Jan 12, 2024
Merged

feat(vitest): show slow test duration in verbose reporter on CI#4929
sheremet-va merged 2 commits intovitest-dev:mainfrom
hi-ogawa:feat-ci-verbose-reporter-duration

Conversation

@hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Jan 11, 2024

Description

This will make the output similar to non-CI reporters which use list renderer:

if (task.result?.duration != null) {
if (task.result.duration > options.slowTestThreshold)
suffix += c.yellow(` ${Math.round(task.result.duration)}${c.dim('ms')}`)
}

Regarding the documentation, currently https://vitest.dev/guide/reporters.html doesn't mention anything about CI mode and the example output https://vitest.dev/guide/reporters.html#verbose-reporter shows non-CI mode output. So, probably documentation change is not necessary.

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:.

@netlify
Copy link

netlify bot commented Jan 11, 2024

Deploy Preview for fastidious-cascaron-4ded94 canceled.

Name Link
🔨 Latest commit 23ea9ac
🔍 Latest deploy log https://app.netlify.com/sites/fastidious-cascaron-4ded94/deploys/659f4b328eaf4d0008948d75

@hi-ogawa hi-ogawa marked this pull request as ready for review January 11, 2024 02:35
@sheremet-va sheremet-va added this to the 1.2.0 milestone Jan 11, 2024
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.

Reporters verbose does not show timings in output when CI is active

3 participants