14 lines
480 B
TypeScript
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');
|
|
});
|
|
});
|