3import { URLCrawler } from "./urlCrawlerComponent";
45export async function checkWebsite(inputURL: string) {
6const urlReceiver = new URLReceiver();
7const urlCrawler = new URLCrawler(3);
1export default async function (e: Email) {
2
3}
1export default async function (interval: Interval) {
2
3}
1export default async function (req: Request): Promise<Response> {
2return Response.json({ ok: true })
3}
1export default async function (req: Request): Promise<Response> {
23
1export default async function (e: Email) {
2
3}
1export default async function (req: Request): Promise<Response> {
2return Response.json({ ok: true })
3}
1export default async function (interval: Interval) {
2
3}
URLReceivermainFunctionTest2 matches
1import { expect } from "jsr:@std/expect";
2import { checkWebsite } from "./mainFunctionURLReciver2";
34console.log("Starting Website Checker Tests");
12];
1314async function runTests() {
15console.log("\nTesting valid website URL");
16let result = await checkWebsite(TEST_URLS[0]);
URLReceiversummaryURLReceiverTest7 matches
47interface TestCase {
48description: string;
49function: Function;
50expectedBehavior: string;
51}
5253function logTestInfo(message: string) {
54console.log(` ${message}`);
55}
59description: "Initialize generator",
60expectedBehavior: "Should start with empty state",
61function: () => {
62console.log("\nTEST: Initialize generator");
63console.log("Expected: Should start with no URLs processed\n");
83description: "Process test URLs",
84expectedBehavior: "Should identify working and broken URLs",
85function: () => {
86console.log("\nTEST: Processing multiple URLs");
87console.log("Expected: Should correctly identify good and bad URLs\n");
124description: "Test error handling",
125expectedBehavior: "Should handle different types of errors",
126function: () => {
127console.log("\nTEST: Error handling");
128console.log("Expected: Should identify and explain different errors\n");
182];
183184async function runTests() {
185console.log("Starting test run...\n");
186let passed = 0;
189for (const test of tests) {
190try {
191await test.function();
192console.log("\n✅ TEST PASSED");
193passed++;