Commit fdc8639
committed
feat(@schematics/angular): configure Vitest for new projects and libraries
This commit updates the application and library schematics to configure Vitest as the unit testing framework, replacing Karma and Jasmine.
Key changes:
Application Schematic:
- Sets '@angular/build:unit-test' as the default builder for the 'test' target.
- Adds 'vitest' and 'jsdom' as default dev dependencies.
- Removes Karma, Jasmine, and related packages from the generated 'package.json'.
- Updates 'tsconfig.spec.json' to include 'vitest/globals' for type support.
Library Schematic:
- Conditionally configures the 'test' target with the '@angular/build:unit-test' builder if Vitest is detected in the workspace.
- Dynamically sets the 'types' in 'tsconfig.spec.json' to 'vitest/globals' or 'jasmine' based on the presence of Vitest.1 parent 0ae9c99 commit fdc8639
File tree
11 files changed
+70
-59
lines changed- packages/schematics/angular
- application
- files/common-files
- config
- library
- files
- utility
- latest-versions
- workspace/files
- tests/legacy-cli/e2e/utils
11 files changed
+70
-59
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
186 | 201 | | |
187 | 202 | | |
188 | 203 | | |
| |||
327 | 342 | | |
328 | 343 | | |
329 | 344 | | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
340 | 351 | | |
341 | | - | |
342 | 352 | | |
343 | 353 | | |
344 | 354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | 394 | | |
401 | 395 | | |
402 | 396 | | |
| |||
407 | 401 | | |
408 | 402 | | |
409 | 403 | | |
410 | | - | |
411 | | - | |
412 | 404 | | |
413 | 405 | | |
414 | 406 | | |
| |||
421 | 413 | | |
422 | 414 | | |
423 | 415 | | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | 416 | | |
428 | 417 | | |
429 | 418 | | |
| |||
435 | 424 | | |
436 | 425 | | |
437 | 426 | | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | 427 | | |
442 | 428 | | |
443 | 429 | | |
| |||
449 | 435 | | |
450 | 436 | | |
451 | 437 | | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | 438 | | |
456 | 439 | | |
457 | 440 | | |
| |||
482 | 465 | | |
483 | 466 | | |
484 | 467 | | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | 468 | | |
492 | 469 | | |
493 | 470 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
122 | 130 | | |
123 | 131 | | |
124 | 132 | | |
| |||
150 | 158 | | |
151 | 159 | | |
152 | 160 | | |
| 161 | + | |
153 | 162 | | |
154 | 163 | | |
155 | 164 | | |
| |||
163 | 172 | | |
164 | 173 | | |
165 | 174 | | |
| 175 | + | |
166 | 176 | | |
167 | 177 | | |
168 | 178 | | |
| |||
171 | 181 | | |
172 | 182 | | |
173 | 183 | | |
174 | | - | |
| 184 | + | |
175 | 185 | | |
176 | 186 | | |
177 | 187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
417 | 428 | | |
418 | 429 | | |
419 | 430 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
Lines changed: 1 addition & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 37 | + | |
45 | 38 | | |
46 | 39 | | |
47 | 40 | | |
0 commit comments