import { DirectFetchAdapter } from '../src//infrastructure/adapters/direct-fetch.adapter'; describe('DirectFetchAdapter', () => { let adapter: DirectFetchAdapter; beforeEach(() => { adapter = new DirectFetchAdapter(); }); it('fetches HTML from a valid URL', async () => { const html = await adapter.fetch('https://httpbin.org/html'); expect(html).toContain(''); }); it('throws on non-200 response', async () => { await expect(adapter.fetch('https://httpbin.org/status/404')).rejects.toThrow(); }); it('throws on non-HTML content type', async () => { await expect(adapter.fetch('https://httpbin.org/json')).rejects.toThrow( 'non-HTML' ); }); });