Commit 1672128
committed
fix(@angular/build): correct Vitest builder watch mode execution
The experimental Vitest-based unit test builder did not always correctly re-run tests in watch mode.
This commit refactors the Vitest executor to provide more accurate watch mode behavior by:
- Using `createVitest` to create a persistent instance that can be programmatically controlled.
- Disabling Vitest's internal file watcher (`watch: false`) to make the Angular builder's watcher the single source of truth.
- Triggering a test run via `vitest.start()` within the `execute` method after each incremental build is complete.1 parent b3dfc91 commit 1672128
File tree
1 file changed
+9
-6
lines changed- packages/angular/build/src/builders/unit-test/runners/vitest
1 file changed
+9
-6
lines changedLines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
56 | | - | |
57 | | - | |
| 61 | + | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
| |||
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
72 | | - | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| |||
99 | 103 | | |
100 | 104 | | |
101 | 105 | | |
102 | | - | |
| 106 | + | |
103 | 107 | | |
104 | | - | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
| |||
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
113 | | - | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| |||
0 commit comments