You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/plugin-coverage/README.md
+55-15
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ Measured coverage types are mapped to Code PushUp audits in the following way
43
43
};
44
44
```
45
45
46
-
4. (Optional) Reference audits which you wish to include in custom categories (use `npx code-pushup print-config` to list audits and groups).
46
+
4. (Optional) Reference individual audits or the provided plugin group which you wish to include in custom categories (use `npx code-pushup print-config` to list audits and groups).
47
47
48
48
💡 Assign weights based on what influence each coverage type should have on the overall category score (assign weight 0 to only include as extra info, without influencing category score).
49
49
@@ -56,21 +56,9 @@ Measured coverage types are mapped to Code PushUp audits in the following way
56
56
title:'Code coverage',
57
57
refs: [
58
58
{
59
-
type:'audit',
60
-
plugin:'coverage',
61
-
slug:'function-coverage',
62
-
weight:2,
63
-
},
64
-
{
65
-
type:'audit',
59
+
type:'group',
66
60
plugin:'coverage',
67
-
slug:'branch-coverage',
68
-
weight:1,
69
-
},
70
-
{
71
-
type:'audit',
72
-
plugin:'coverage',
73
-
slug:'line-coverage',
61
+
slug:'coverage',
74
62
weight:1,
75
63
},
76
64
// ...
@@ -126,6 +114,58 @@ The plugin accepts the following parameters:
126
114
- (optional) `coverageToolCommand`: If you wish to run your coverage tool to generate the results first, you may define it here.
127
115
- (optional) `perfectScoreThreshold`: If your coverage goal is not 100%, you may define it here in range 0-1. Any score above the defined threshold will be given the perfect score. The value will stay unaffected.
128
116
117
+
### Audits and group
118
+
119
+
This plugin provides a group for convenient declaration in your config. When defined this way, all measured coverage type audits have the same weight.
120
+
121
+
```ts
122
+
// ...
123
+
categories: [
124
+
{
125
+
slug: 'code-coverage',
126
+
title: 'Code coverage',
127
+
refs: [
128
+
{
129
+
type: 'group',
130
+
plugin: 'coverage',
131
+
slug: 'coverage',
132
+
weight: 1,
133
+
},
134
+
// ...
135
+
],
136
+
},
137
+
// ...
138
+
],
139
+
```
140
+
141
+
Each coverage type still has its own audit. So when you want to include a subset of coverage types or assign different weights to them, you can do so in the following way:
142
+
143
+
```ts
144
+
// ...
145
+
categories: [
146
+
{
147
+
slug: 'code-coverage',
148
+
title: 'Code coverage',
149
+
refs: [
150
+
{
151
+
type: 'audit',
152
+
plugin: 'coverage',
153
+
slug: 'function-coverage',
154
+
weight: 2,
155
+
},
156
+
{
157
+
type: 'audit',
158
+
plugin: 'coverage',
159
+
slug: 'branch-coverage',
160
+
weight: 1,
161
+
},
162
+
// ...
163
+
],
164
+
},
165
+
// ...
166
+
],
167
+
```
168
+
129
169
### Audit output
130
170
131
171
An audit is an aggregation of all results for one coverage type passed to the plugin.
0 commit comments