feature: First push to git

This commit is contained in:
Keith Solomon
2026-05-16 14:02:49 -05:00
commit 265f69d95a
46 changed files with 11551 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import { describe, expect, it } from 'vitest';
import { enrichLink } from '../src/enrichment/enricher.js';
describe('enrichment', () => {
it('marks dead, paywall, and unreachable links', async () => {
await expect(
enrichLink('https://x.test/dead', async () => ({
status: 404,
finalUrl: 'https://x.test/dead',
html: ''
}))
).resolves.toMatchObject({
status: 'dead'
});
await expect(
enrichLink('https://x.test/a', async () => ({
status: 200,
finalUrl: 'https://x.test/login',
html: '<title>Login</title>'
}))
).resolves.toMatchObject({ status: 'paywall' });
await expect(
enrichLink('https://x.test/a', async () => Promise.reject(new Error('timeout')))
).resolves.toMatchObject({
status: 'unreachable'
});
});
});