Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/components/__tests__/ThemeController.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ const { mockGetColorAsync, mockDestroy } = vi.hoisted(() => ({
// The hook uses fast-average-color, which we need to mock so it doesn't try to fetch real images in tests.
vi.mock("fast-average-color", () => {
return {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
FastAverageColor: vi.fn().mockImplementation(function(this: any) {
this.getColorAsync = mockGetColorAsync;
this.destroy = mockDestroy;
return this;
FastAverageColor: vi.fn().mockImplementation(function() {
return {
getColorAsync: mockGetColorAsync,
destroy: mockDestroy,
};
}),
Comment thread
is0692vs marked this conversation as resolved.
};
});
Expand All @@ -44,8 +44,7 @@ describe("ThemeController", () => {
value: [100, 150, 200, 255]
});
// Ensure adjustAccentColor mock implementation is restored
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(colorLib.adjustAccentColor as any).mockImplementation((color: any) => ({
vi.mocked(colorLib.adjustAccentColor).mockImplementation((color) => ({
accent: `mock-accent-${color}`,
accentRgb: `mock-rgb-${color}`,
accentHover: `mock-hover-${color}`,
Expand Down
Loading