-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description
ESLint is generating warnings for the use of `as any` type assertions in edge case tests.
Location
`src/tests/low-coverage-countries.test.ts` lines 367-368 (and potentially other similar cases)
Current Code
```typescript
expect(validateNationalId('HUN', null as any).isValid).toBe(false);
expect(validateNationalId('ISL', undefined as any).isValid).toBe(false);
```
Warning Message
Unexpected any. Specify a different type
@typescript-eslint/no-explicit-any
Proposed Solution
Replace `as any` with `as unknown as string` to maintain type safety while still testing edge cases:
```typescript
expect(validateNationalId('HUN', null as unknown as string).isValid).toBe(false);
expect(validateNationalId('ISL', undefined as unknown as string).isValid).toBe(false);
```
Tasks
- Audit all test files for `as any` usage
- Replace with `as unknown as string` or appropriate type
- Verify all tests still pass
- Ensure ESLint warnings are resolved
Impact
- Low priority - these are warnings, not errors
- All checks currently pass
- Improves code quality and type safety
Labels
refactor, tests, code-quality, tech-debt
Metadata
Metadata
Assignees
Labels
No labels