Commit e36bf96
committed
fix(@angular/build): allow TestBed provider configuration with vitest unit-testing
The experimental `unit-test` builder with the `vitest` runner configured
can now specify an Angular providers file via the `providersFile` option.
This allows the TestBed initialization to use the providers defined in
this file for all executed tests. The contents of the providers file should
include a default export with an array of one or more Angular providers.
As an example:
```
import { provideZonelessChangeDetection } from '@angular/core';
export default [
provideZonelessChangeDetection(),
];
```
(cherry picked from commit ceaf6b5)1 parent 0af4e10 commit e36bf96
File tree
3 files changed
+20
-1
lines changed- packages/angular/build/src/builders/unit-test
3 files changed
+20
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
149 | 157 | | |
150 | 158 | | |
151 | 159 | | |
152 | 160 | | |
153 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
154 | 167 | | |
155 | 168 | | |
156 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
| |||
0 commit comments