Skip to content

sapphi-red/vitest-github-actions-reporter

This branch is up to date with main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2976233 · Feb 21, 2024
Nov 19, 2023
Nov 30, 2023
Nov 19, 2023
Sep 17, 2023
Mar 2, 2022
Mar 2, 2022
Feb 26, 2023
Mar 2, 2022
Mar 2, 2022
Feb 21, 2024
Nov 30, 2023
Nov 19, 2023
Apr 30, 2023
Oct 30, 2022
Feb 26, 2023

Repository files navigation

vitest-github-actions-reporter

npm version CI MIT License

Vitest reporter to create annotations when running tests in GitHub Actions.

Warning

Vitest 1.3.0+ comes with a builtin support for creating annotations in GitHub Actions.
This reporter is not needed for those versions.

image

Thanks to jest-github-actions-reporter for the ideas.

Install

npm i -D vitest-github-actions-reporter # yarn add -D vitest-github-actions-reporter

Usage

Add this reporter to vite.config.js / vite.config.ts.

// vite.config.js / vite.config.ts
import GithubActionsReporter from 'vitest-github-actions-reporter'

export default {
  test: {
    reporters: process.env.GITHUB_ACTIONS
      ? ['default', new GithubActionsReporter()]
      : 'default'
  }
}

Then run vitest with GitHub Actions. That's all. GitHub Actions will do everything other.

Options

trimRepositoryPrefix

Default: true
Trims /home/runner/{repository name} / D:\a\{repository name} in stacktrace. The image below is a preview when it is false. image

hideStackTrace

Default: false
Hides stack trace in the message. The image below is a preview when it is true. image