Remove explicit any types from 2 test files:
- firebaseAuthStore.test.ts (10 instances)
- useMinimapSettings.test.ts (10 instances)
Changes:
- Created MockAuth type for firebase auth mocks
- Used UserCredential type for firebase user credential mocks
- Used `ReturnType<typeof func>` to derive proper store types
- Changed Record<string, any> to Record<string, unknown>
All changes pass typecheck and tests.
Remove explicit any types from 3 test files:
- SubgraphMemory.test.ts (10 instances)
- minimapCanvasRenderer.test.ts (8 instances)
- useImageLoader.test.ts (8 instances)
Changes:
- Created InputWithWidget type for test-specific widget properties
- Used `unknown` type with proper type annotations for mock store properties
- Used `as unknown as T` pattern for mock objects
- Used `ReturnType<typeof func>` for store mock return types
All changes pass typecheck and tests.
Remove explicit any types from 7 test files:
- useWatchWidget.test.ts (3 instances)
- LGraphNodeProperties.test.ts (2 instances)
- versionCompatibilityStore.test.ts (2 instances)
- workflowStore.test.ts (2 instances)
- useRemoteWidget.test.ts (2 instances)
- registrySearchGateway.test.ts (2 instances)
- colorUtil.test.ts (2 instances)
Changes:
- Used `unknown` for truly unknown values instead of `any`
- Used `Partial<T>` with type assertions for mock objects
- Used `ReturnType<typeof func>` to derive proper types
- Used proper typing for promise resolvers and spy mocks
- Used `this: unknown` with proper casting for function contexts
All changes pass typecheck and tests.
- useMinimap.test.ts: Created comprehensive mock interfaces for Node, Graph, Canvas, CanvasElement, ContainerElement, and Context2D
- firebaseAuthStore.test.ts: Imported User type from firebase/auth and created MockUser type for mocking
Part 8 - Phase 5 complete: 2 files fixed, 14 any instances removed (9 + 5)
- releaseStore.test.ts: Created mock interfaces for ReleaseService, SettingStore, and SystemStatsStore with proper typing
- ExecuteButton.test.ts: Added Mock type interfaces for Canvas, CanvasStore, and CommandStore
- useManagerQueue.test.ts: Fixed Ref types and used correct ManagerPackInstalled schema types
Part 8 - Phase 4 complete: 8 files fixed, 32 any instances removed
- Change parameter types from string to unknown in both functions
- Functions already have type guards (typeof check) to handle invalid inputs
- Remove all 'as any' casts from tests - no longer needed
- Better type safety: functions now properly express they can handle any input
- Import SettingParams, SettingTreeNode types from settingStore
- Replace mockSettingStore: any with ReturnType<typeof useSettingStore>
- Replace mockSettings: any with properly typed Record<string, SettingParams> with double-cast
- Replace setting: any parameter with SettingParams in getSettingInfo mock
- Replace activeCategory as any with Partial<SettingTreeNode> and proper cast
- Add casts for dynamically assigned mock settings
- Define RegistryNodePack type from comfyRegistryTypes
- Create GlobalWithAlgolia interface for global properties
- Replace (global as any) with properly typed (globalThis as unknown as GlobalWithAlgolia)
- Type testPack and incompletePack as Partial<RegistryNodePack>
- Replace as any casts with as RegistryNodePack
- Replace ...args: any[] with proper return type annotations
- Replace (original as any).apply() with original.call()
- Replace (originalGetCanvasMenuOptions as any).apply() with .call()
- Add explicit return type (IContextMenuValue | null)[] to functions
- Import IContextMenuValue and LGraphNode types
- Replace ...args: any[] with proper parameter types (none for getCanvasMenuOptions, node: LGraphNode for getNodeMenuOptions)
- Replace (original as any).apply() with original.call() with proper typing
- Add explicit return type annotation for monkey-patched methods
- Import SystemStats type from apiSchema
- Replace null as any with proper SystemStats type
- Replace Promise<any> with Promise<SystemStats>
- Replace partial system object cast with SystemStats['system']
- Add necessary cast for empty object in test
- Define MockWebSocket interface with proper Mock types
- Replace mockWebSocket: any with MockWebSocket type
- Replace event: any with unknown in event handlers
- Import Mock type from vitest
- Update mockQueryParams type to include string[] for Vue Router query params
- Replace params?: any with unknown and inline type assertion
- Remove unnecessary 'as any' casts from array assignments
- Define NodeConstructorWithSlotOffset interface for constructor with optional slot_start_y
- Replace 3 'as any' casts with proper double-cast pattern
- All instances related to dynamic slot_start_y property on node constructor
- Define MockNodeInput interface for test inputs
- Replace widgets value: any with unknown
- Replace const node: any with proper object and double-cast to LGraphNode
- Add explicit return type boolean to isInputConnected
- Replace activeWorkflow mock with LoadedComfyWorkflow type and double-cast
- Replace selectedItems mocks with Positionable type and double-cast
- Import Mock type from vitest for checkState mock
- Define MockSettingStore interface with proper Mock types
- Create mockSettingStoreTyped with double-cast to useSettingStore return type
- Replace all mockSettingStore usages in initializeIfNewUser calls
- Import useSettingStore type from correct path
- Define MockSearchClient interface with search: Mock property
- Replace mockSearchClient: any with MockSearchClient type
- Apply double-cast when setting up mock return value
- Note: File still has other any instances for global properties and test casts
- Replace mockColorContext: any with proper MockColorContext interface
- Apply double-cast at draw() call sites to satisfy DefaultConnectionColors type
- Pattern: colorContext: mockColorContext as unknown as DefaultConnectionColors
- Replace `wrapper.vm as any` with properly typed ComponentInstance
- Define ComponentInstance type with error property
- Improve type safety for internal state access in tests
Part of Phase 2 - Quick wins (1 instance removed)
- Replace `events: any[]` with properly typed `MockEvent[]`
- Define MockEvent interface matching the test data structure
- Improve type safety for event testing
Part of Phase 2 - Quick wins (1 instance removed)
- Replace `props: any` with ComponentProps<typeof ApiKeyForm>
- Import ComponentProps from vue-component-type-helpers
- Linter optimized to direct ComponentProps usage
Part of Phase 2 - Quick wins (1 instance removed)
- Replace `props: any` and return type with proper types
- Use Record<string, unknown> with ComponentProps cast
- Refactor tests to check FormItem component props instead of internal state
- Import ComponentProps from vue-component-type-helpers
Part of Phase 2 - Quick wins (1 instance removed)
- Replace `props: any` with `Record<string, unknown>`
- Use ComponentProps type assertion for type safety
- Import ComponentProps from vue-component-type-helpers
Part of Phase 2 - Quick wins (1 instance removed)
- Replace `as any` with proper `Mock` type from vitest
- Import Mock type and access mock.calls with type safety
- Explicitly type selectionCallback as `() => void`
- Break down mock access into steps for clarity
Part of Phase 2 - Quick wins (1 instance removed)
- Replace `props: any` with `Record<string, unknown>`
- Use ComponentProps type assertion for type safety
- Refactor tests to check input.element.value instead of internal state
- This tests actual DOM behavior rather than implementation details
Part of Phase 2 - Quick wins (1 instance removed)
Replaced any with Record<string, unknown> for mountComponent props parameter.
Uses as unknown as cast to allow testing edge cases with invalid prop types.
All tests passing (11/11), 0 typecheck errors.
Part of #8092
Removed all 14 any types from Pinia store mocks.
Changes:
- Replaced as any with as unknown as ReturnType<typeof store> pattern
- Removed as any from $state and _p properties (empty objects)
All tests passing (6/6), 0 typecheck errors.
Part of #8092
Replaced any with proper type for mockCanvas.
Changes:
- Typed mockCanvas as { selectedItems: Set<Positionable> }
- Added as unknown as Positionable casts for MockNode instances
- Added as unknown as cast for getCanvas mock return value
All tests passing (18/18), 0 typecheck errors.
Part of #8092
Removed all 3 any types and replaced with proper TypeScript types.
Changes:
- Replaced as any with as unknown as for partial mockCanvasStore
- Removed as any from null assignments (TypeScript infers correctly)
All tests passing (7/7), 0 typecheck errors.
Part of #8092
Removed all 7 any types by removing unnecessary type assertions.
TypeScript can infer return types correctly for mockImplementation
callbacks returning literal values.
All tests passing (8/8), 0 typecheck errors.
Part of #8092
Removed all 3 any types and replaced with proper TypeScript types.
Changes:
- Replaced as any with Partial<ReturnType<typeof useSettingStore>>
- Used as unknown as for partial mock subgraph (114+ missing properties)
All tests passing (3/3), 0 typecheck errors.
Part of #8092
Introduces `useFeatureUsageTracker` composable that tracks how many
times a user has used a specific feature, along with first and last
usage timestamps. Data persists to localStorage using `@vueuse/core`'s
`useStorage`. This composable provides the foundation for triggering
surveys after a configurable number of feature uses. Includes
comprehensive unit tests.
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8175-feat-add-feature-usage-tracker-for-nightly-surveys-2ee6d73d36508118859ece6fcf17561d)
by [Unito](https://www.unito.io)
Removed all 11 any types and replaced with proper TypeScript types.
Changes:
- Typed executionStore mock with proper structure
- Typed workflowStore.activeWorkflow based on actual usage
- Replaced (settingStore.get as any) with vi.mocked(settingStore.get)
- Fixed vi.fn() signature to accept key parameter
All tests passing (8/9, 1 skipped), 0 typecheck errors.
Part of #8092