mirror of
https://github.com/aljazceru/ditto.git
synced 2026-02-15 18:34:19 +01:00
15 lines
383 B
TypeScript
15 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));
|
|
}
|