Skip to content

Commit 23185f4

Browse files
committed
Fix test mock: use constructible function implementation for OpenAPIClient mock and allow ESLint exception\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 33e4718 commit 23185f4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎test/device/water-detector-battery.spec.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ const openApiMocks = vi.hoisted(() => {
66
const getStatus = vi.fn()
77
return {
88
getStatus,
9-
OpenAPIClient: vi.fn().mockImplementation(() => ({ getStatus })),
9+
// Use a function implementation so the mock is constructible with `new OpenAPIClient()`
10+
// eslint-disable-next-line prefer-arrow-callback
11+
OpenAPIClient: vi.fn().mockImplementation(function () { return { getStatus } }),
1012

1113
}
1214
})

0 commit comments

Comments
 (0)