Commit 0c70980
test(data-fabric): make ApiClient mocks constructable for vitest 4 (#571)
The DataFabric directory and roles service tests landed after the vitest-4
mock migration, so they still mocked ApiClient with an arrow function:
`vi.mocked(ApiClient).mockImplementation(() => mockApiClient as unknown as ApiClient)`.
Vitest 4 constructs mock implementations via the function's [[Construct]] slot,
which arrow functions lack, so `new ApiClient(...)` in the service constructor
threw `() => ... is not a constructor` and both suites failed to run.
Converted both to constructable regular functions, matching every other
service test. Full unit suite (2021 tests) passes on vitest 4.1.9.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 7f13da9 commit 0c70980
2 files changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
0 commit comments