generated from nhcarrigan/template
style: fix lint errors in test files
- Remove unused imports in config.test.ts and conversations.test.ts - Remove unused handler variable in tauri.test.ts - Remove unused _args parameter in vitest.setup.ts mock - Add coverage/ to eslint ignore list
This commit is contained in:
+1
-1
@@ -27,6 +27,6 @@ export default tseslint.config(
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ignores: ["build/", ".svelte-kit/", "dist/", "src-tauri/target/", "node_modules/"],
|
ignores: ["build/", ".svelte-kit/", "dist/", "src-tauri/target/", "node_modules/", "coverage/"],
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
import { describe, it, expect, beforeEach, vi } from "vitest";
|
import { describe, it, expect, beforeEach, vi } from "vitest";
|
||||||
import { get } from "svelte/store";
|
|
||||||
import {
|
import {
|
||||||
configStore,
|
configStore,
|
||||||
isDarkTheme,
|
|
||||||
isStreamerMode,
|
|
||||||
isCompactMode,
|
|
||||||
shouldHidePaths,
|
|
||||||
maskPaths,
|
maskPaths,
|
||||||
clampFontSize,
|
clampFontSize,
|
||||||
applyFontSize,
|
applyFontSize,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { describe, it, expect, beforeEach, vi } from "vitest";
|
import { describe, it, expect } from "vitest";
|
||||||
import { get } from "svelte/store";
|
|
||||||
|
|
||||||
// Test the Conversation interface and store behavior
|
// Test the Conversation interface and store behavior
|
||||||
describe("Conversation interface", () => {
|
describe("Conversation interface", () => {
|
||||||
@@ -252,7 +251,7 @@ describe("conversation management operations", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("uses default name when not provided", () => {
|
it("uses default name when not provided", () => {
|
||||||
let counter = 5;
|
const counter = 5;
|
||||||
const createNewConversation = (name?: string) => ({
|
const createNewConversation = (name?: string) => ({
|
||||||
name: name || `Conversation ${counter}`,
|
name: name || `Conversation ${counter}`,
|
||||||
});
|
});
|
||||||
@@ -452,9 +451,7 @@ describe("attachment management", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("clears all attachments", () => {
|
it("clears all attachments", () => {
|
||||||
const attachments = [{ id: "att-1" }, { id: "att-2" }];
|
const cleared: Array<{ id: string }> = [];
|
||||||
|
|
||||||
const cleared: typeof attachments = [];
|
|
||||||
expect(cleared).toHaveLength(0);
|
expect(cleared).toHaveLength(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -319,8 +319,6 @@ describe("tauri event handling", () => {
|
|||||||
|
|
||||||
describe("mock event system", () => {
|
describe("mock event system", () => {
|
||||||
it("can emit events through mock system", () => {
|
it("can emit events through mock system", () => {
|
||||||
const handler = vi.fn();
|
|
||||||
|
|
||||||
// The emitMockEvent function should work
|
// The emitMockEvent function should work
|
||||||
expect(typeof emitMockEvent).toBe("function");
|
expect(typeof emitMockEvent).toBe("function");
|
||||||
});
|
});
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ export function clearMockInvokeResults() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
vi.mock("@tauri-apps/api/core", () => ({
|
vi.mock("@tauri-apps/api/core", () => ({
|
||||||
invoke: vi.fn((command: string, _args?: Record<string, unknown>) => {
|
invoke: vi.fn((command: string) => {
|
||||||
if (command in mockInvokeResults) {
|
if (command in mockInvokeResults) {
|
||||||
const result = mockInvokeResults[command];
|
const result = mockInvokeResults[command];
|
||||||
if (result instanceof Error) {
|
if (result instanceof Error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user