Commit cd1479e
committed
fix(test): use proper function syntax for Vitest constructor mocks
Vitest requires mocks used as constructors to use 'function' keyword
instead of arrow functions. This fixes 15 failing unit tests across
two test files.
Changes:
- providers.test.mts: Use vi.fn(function() {...}) for Gitlab mock
- config.test.mts: Replace all arrow functions with proper function
syntax in mock implementations
All 25 tests in both files now pass successfully.1 parent 26f016b commit cd1479e
File tree
2 files changed
+34
-32
lines changed- packages/cli/src/utils
- git
- npm
2 files changed
+34
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
21 | 12 | | |
22 | 13 | | |
23 | 14 | | |
24 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
25 | 18 | | |
26 | 19 | | |
27 | 20 | | |
| 21 | + | |
28 | 22 | | |
29 | 23 | | |
30 | 24 | | |
| |||
38 | 32 | | |
39 | 33 | | |
40 | 34 | | |
| 35 | + | |
| 36 | + | |
41 | 37 | | |
42 | 38 | | |
43 | 39 | | |
44 | 40 | | |
45 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
| |||
143 | 141 | | |
144 | 142 | | |
145 | 143 | | |
146 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
0 commit comments