Files
Newsletter-Link-Catalog/tests/parsing.test.ts
T
2026-05-16 14:02:49 -05:00

14 lines
480 B
TypeScript

import { describe, expect, it } from 'vitest';
import { selectParser } from '../src/parsing/plugins.js';
describe('parser plugin selection', () => {
it('selects Substack for Substack headers and generic otherwise', () => {
expect(selectParser({ headers: { listId: 'thing.substack.com' }, html: '' }).name).toBe(
'substack'
);
expect(
selectParser({ headers: {}, html: '<a href="https://example.com">Example</a>' }).name
).toBe('generic');
});
});