chore: tighten lint rules and tests

This commit is contained in:
Peter Steinberger
2025-12-31 19:36:33 +01:00
parent 464b50b2fd
commit fc77190929
18 changed files with 1257 additions and 137 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
import { describe, expect, it } from 'vitest';
import { mentionsQueryFromUserOption, normalizeHandle } from '../src/lib/normalize-handle.js';
const INVALID_HANDLE_REGEX = /Invalid --user handle/;
describe('normalizeHandle', () => {
it('accepts bare handle', () => {
expect(normalizeHandle('steipete')).toBe('steipete');
@@ -36,6 +38,6 @@ describe('mentionsQueryFromUserOption', () => {
it('returns error for invalid handle', () => {
const result = mentionsQueryFromUserOption('@stei-pete');
expect(result.query).toBeNull();
expect(result.error).toMatch(/Invalid --user handle/);
expect(result.error).toMatch(INVALID_HANDLE_REGEX);
});
});