Commit 66dd6dd
committed
feat(@angular/build): allow options for unit test reporters
This change enhances the `reporters` option in the unit-test builder to support passing an options object, similar to the existing `codeCoverageReporters` option. Users can now specify a reporter as a tuple of `[name, options]`.
- The `schema.json` is updated to allow either a string or a `[string, object]` tuple in the `reporters` array. An `enum` is provided for common reporters while still allowing custom string paths.
- The option normalization logic in `options.ts` is refactored into a shared helper function to handle both `reporters` and `codeCoverageReporters`, reducing code duplication.
- The Karma runner, which does not support reporter options, is updated to safely ignore them and warn the user.1 parent 69c3b12 commit 66dd6ddCopy full SHA for 66dd6dd
File tree
Expand file treeCollapse file tree
5 files changed
+106
-24
lines changedOpen diff view settings
Filter options
- goldens/public-api/angular/build
- packages/angular/build/src/builders/unit-test
- runners/karma
- tests/options
Expand file treeCollapse file tree
5 files changed
+106
-24
lines changedOpen diff view settings
Collapse file
goldens/public-api/angular/build/index.api.md
Copy file name to clipboardExpand all lines: goldens/public-api/angular/build/index.api.md+1-1Lines changed: 1 addition & 1 deletion
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
225 | 225 | |
226 | 226 | |
227 | 227 | |
228 | | - |
| 228 | + |
229 | 229 | |
230 | 230 | |
231 | 231 | |
|
Collapse file
packages/angular/build/src/builders/unit-test/options.ts
Copy file name to clipboardExpand all lines: packages/angular/build/src/builders/unit-test/options.ts+13-7Lines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
15 | 15 | |
16 | 16 | |
17 | 17 | |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
18 | 28 | |
19 | 29 | |
20 | 30 | |
| ||
33 | 43 | |
34 | 44 | |
35 | 45 | |
36 | | - |
| 46 | + |
37 | 47 | |
38 | 48 | |
39 | 49 | |
| ||
49 | 59 | |
50 | 60 | |
51 | 61 | |
52 | | - |
53 | | - |
54 | | - |
55 | | - |
56 | | - |
| 62 | + |
57 | 63 | |
58 | 64 | |
59 | 65 | |
60 | 66 | |
61 | | - |
| 67 | + |
62 | 68 | |
63 | 69 | |
64 | 70 | |
|
Collapse file
packages/angular/build/src/builders/unit-test/runners/karma/executor.ts
Copy file name to clipboardExpand all lines: packages/angular/build/src/builders/unit-test/runners/karma/executor.ts+10-1Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
60 | 60 | |
61 | 61 | |
62 | 62 | |
63 | | - |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
64 | 73 | |
65 | 74 | |
66 | 75 | |
|
Collapse file
packages/angular/build/src/builders/unit-test/schema.json
Copy file name to clipboardExpand all lines: packages/angular/build/src/builders/unit-test/schema.json+37-2Lines changed: 37 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
88 | 88 | |
89 | 89 | |
90 | 90 | |
91 | | - |
| 91 | + |
92 | 92 | |
93 | | - |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | + |
94 | 125 | |
95 | 126 | |
96 | 127 | |
| ||
124 | 155 | |
125 | 156 | |
126 | 157 | |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | + |
127 | 162 | |
128 | 163 | |
129 | 164 | |
Collapse file
packages/angular/build/src/builders/unit-test/tests/options/reporters_spec.ts
Copy file name to clipboardExpand all lines: packages/angular/build/src/builders/unit-test/tests/options/reporters_spec.ts+45-13Lines changed: 45 additions & 13 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
15 | 15 | |
16 | 16 | |
17 | 17 | |
18 | | - |
19 | | - |
| 18 | + |
| 19 | + |
20 | 20 | |
21 | 21 | |
22 | 22 | |
23 | | - |
| 23 | + |
24 | 24 | |
25 | 25 | |
| 26 | + |
26 | 27 | |
27 | 28 | |
28 | | - |
| 29 | + |
29 | 30 | |
30 | | - |
31 | | - |
32 | | - |
33 | 31 | |
34 | 32 | |
35 | | - |
| 33 | + |
36 | 34 | |
37 | 35 | |
38 | | - |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
39 | 73 | |
40 | 74 | |
41 | | - |
| 75 | + |
42 | 76 | |
43 | | - |
44 | | - |
45 | | - |
| 77 | + |
46 | 78 | |
47 | 79 | |
48 | 80 | |
0 commit comments