1
1
# vitest-github-actions-reporter
2
2
3
- [ ![ npm version] ( https://badge.fury.io/js/vitest-github-actions-reporter.svg )] ( https://badge.fury.io/js/vitest-github-actions-reporter ) ![ CI] ( https://github.com/sapphi-red/vitest-github-actions-reporter/workflows/CI/badge.svg ) [ ![ MIT License] ( http://img.shields.io/badge/license-MIT-blue.svg?style=flat )] ( LICENSE )
3
+ [ ![ npm version] ( https://badge.fury.io/js/vitest-github-actions-reporter.svg )] ( https://badge.fury.io/js/vitest-github-actions-reporter ) ![ CI] ( https://github.com/sapphi-red/vitest-github-actions-reporter/workflows/CI/badge.svg ) [ ![ MIT License] ( http://img.shields.io/badge/license-MIT-blue.svg?style=flat )] ( LICENSE )
4
4
5
5
Vitest reporter to create annotations when running tests in GitHub Actions.
6
6
@@ -9,34 +9,43 @@ Vitest reporter to create annotations when running tests in GitHub Actions.
9
9
Thanks to [ ` jest-github-actions-reporter ` ] ( https://github.com/cschleiden/jest-github-actions-reporter ) for ideas.
10
10
11
11
## Install
12
+
12
13
``` shell
13
14
npm i -D vitest-github-actions-reporter # yarn add -D vitest-github-actions-reporter
14
15
```
15
16
16
17
## Usage
18
+
17
19
Add this reporter to ` vite.config.js ` / ` vite.config.ts ` .
20
+
18
21
``` js
19
22
// vite.config.js / vite.config.ts
20
23
import GithubActionsReporter from ' vitest-github-actions-reporter'
21
24
22
25
export default {
23
26
test: {
24
- reporters: process .env .GITHUB_ACTIONS ? new GithubActionsReporter () : ' default'
27
+ reporters: process .env .GITHUB_ACTIONS
28
+ ? new GithubActionsReporter ()
29
+ : ' default'
25
30
}
26
31
}
27
32
```
33
+
28
34
Then run ` vitest ` with GitHub Actions.
29
35
That's all. GitHub Actions will do everything other.
30
36
31
37
## Options
38
+
32
39
### ` trimRepositoryPrefix `
33
- * Default: ` true ` *
40
+
41
+ _ Default: ` true ` _
34
42
Trims ` /home/runner/{repository name} ` / ` D:\a\{repository name} ` in stacktrace.
35
43
The image below is a preview when it is ` false ` .
36
44
![ image] ( https://user-images.githubusercontent.com/49056869/162126739-a3daf5a2-ff37-46c5-b128-bb890fbcf05a.png )
37
45
38
46
### ` hideStackTrace `
39
- * Default: ` false ` *
47
+
48
+ _ Default: ` false ` _
40
49
Hides stacktrace in message.
41
50
The image below is a preview when it is ` true ` .
42
51
![ image] ( https://user-images.githubusercontent.com/49056869/156354039-750a6194-eb76-4adb-bbd6-7c2b65ec80a4.png )
0 commit comments