Commit 63c9874
committed
fix(@angular/build): add webcontainer support for Vitest browser provider
Currently, Vitest's browser providers (playwright, webdriverio) are not compatible with webcontainer environments. This change introduces detection for webcontainers and and automatically configures the Vitest unit test builder to use the `@vitest/browser-preview` provider when running within a webcontainer.
This ensures that browser-based unit tests can execute correctly in webcontainer environments, providing a more consistent development experience across different platforms. The user is notified when the webcontainer environment is detected and the preview provider is activated. Dependency checks are also updated to ensure the correct `@vitest/browser-preview` package is installed when needed.
(cherry picked from commit 50072cd)1 parent 1be35b3 commit 63c9874
File tree
2 files changed
+27
-7
lines changed- packages/angular/build/src/builders/unit-test/runners/vitest
2 files changed
+27
-7
lines changedLines changed: 12 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
26 | | - | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
| |||
102 | 106 | | |
103 | 107 | | |
104 | 108 | | |
105 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
106 | 114 | | |
107 | 115 | | |
108 | 116 | | |
109 | 117 | | |
110 | 118 | | |
111 | 119 | | |
| 120 | + | |
112 | 121 | | |
113 | 122 | | |
114 | 123 | | |
| |||
Lines changed: 15 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| |||
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
50 | 61 | | |
51 | 62 | | |
52 | 63 | | |
| |||
0 commit comments