Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix: replace invalid vi.Mock type references with imported Mock type

Glen Eder607a3d26ceee
diff --git a/tests/api/label/delete-label.test.ts b/tests/api/label/delete-label.test.ts
index 8d9fdbdc9..11c944b9e 100644
--- a/tests/api/label/delete-label.test.ts
+++ b/tests/api/label/delete-label.test.ts
@@ -1,4 +1,12 @@
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+import {
+ afterEach,
+ beforeEach,
+ describe,
+ expect,
+ it,
+ type Mock,
+ vi,
+} from "vitest";
const mockFindFirst = vi.fn();
const mockSelect = vi.fn();
@@ -78,7 +86,7 @@ const TASK_LABEL_2 = {
* The terminal `.where()` returns a Promise resolved to `rows`.
*/
function makeSelectMock(rows: unknown[]) {
- const chain: Record<string, vi.Mock> = {
+ const chain: Record<string, Mock> = {
from: vi.fn(() => chain),
innerJoin: vi.fn(() => chain),
where: vi.fn(() => Promise.resolve(rows)),
@@ -93,7 +101,7 @@ function makeSelectMock(rows: unknown[]) {
* - `.where()` returns a sub-chain that supports `.returning()` and is thenable.
*/
function makeDeleteMock(deletedRow: unknown) {
- const chain: Record<string, vi.Mock> = {};
+ const chain: Record<string, Mock> = {};
// Sub-chain returned by .where():
// - Native Promise.then so `await db.delete().where(...)` works