✨feature: First push to git
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { Categorizer } from '../src/categorization/categorizer.js';
|
||||
|
||||
describe('categorization', () => {
|
||||
it('prefers newsletter section headers', async () => {
|
||||
const categorizer = new Categorizer();
|
||||
await expect(
|
||||
categorizer.categorize({ title: 'Anything', url: 'https://x.test', section: 'Rust' })
|
||||
).resolves.toBe('Rust');
|
||||
});
|
||||
|
||||
it('falls back to URL and keyword rules', async () => {
|
||||
const categorizer = new Categorizer();
|
||||
await expect(
|
||||
categorizer.categorize({ title: 'Kubernetes security guide', url: 'https://example.com/k8s' })
|
||||
).resolves.toBe('DevOps');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user