Skip to content

Commit

Permalink
fixing idempotency test
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelsideguide committed May 27, 2024
1 parent 41c4ef6 commit d5c8380
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ describe('FirecrawlApp E2E Tests', () => {
test('should handle idempotency key for crawl', async () => {
const app = new FirecrawlApp({ apiKey: TEST_API_KEY, apiUrl: API_URL });
const uniqueIdempotencyKey = uuidv4();
const response = await app.crawlUrl('https://firecrawl.dev', { crawlerOptions: { excludes: ['blog/*'] } }, true, 2, uniqueIdempotencyKey);
const response = await app.crawlUrl('https://firecrawl.dev', { crawlerOptions: { excludes: ['blog/*'] } }, false, 2, uniqueIdempotencyKey);
expect(response).not.toBeNull();
expect(response[0].content).toContain("🔥 Firecrawl");
expect(response.jobId).toBeDefined();

await expect(app.crawlUrl('https://firecrawl.dev', { crawlerOptions: { excludes: ['blog/*'] } }, true, 2, uniqueIdempotencyKey)).rejects.toThrow("Request failed with status code 409");
}, 30000); // 30 seconds timeout
});

test('should check crawl status', async () => {
const app = new FirecrawlApp({ apiKey: TEST_API_KEY, apiUrl: API_URL });
Expand Down

0 comments on commit d5c8380

Please sign in to comment.