mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
14 lines
383 B
TypeScript
14 lines
383 B
TypeScript
import { assert } from '@/deps-test.ts';
|
|
|
|
import { fetchWorker } from './fetch.ts';
|
|
|
|
Deno.test('fetchWorker', async () => {
|
|
await sleep(2000);
|
|
const response = await fetchWorker('https://example.com');
|
|
const text = await response.text();
|
|
assert(text.includes('Example Domain'));
|
|
});
|
|
|
|
function sleep(ms: number) {
|
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
}
|