firecrawl-mcp 3.7.3 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,58 @@
1
+ import { jest } from '@jest/globals';
2
+ // Set test timeout
3
+ jest.setTimeout(30000);
4
+ // Create mock responses
5
+ const mockSearchResponse = {
6
+ success: true,
7
+ data: [
8
+ {
9
+ url: 'https://example.com',
10
+ title: 'Test Page',
11
+ description: 'Test Description',
12
+ markdown: '# Test Content',
13
+ actions: null,
14
+ },
15
+ ],
16
+ };
17
+ const mockBatchScrapeResponse = {
18
+ success: true,
19
+ id: 'test-batch-id',
20
+ };
21
+ const mockBatchStatusResponse = {
22
+ success: true,
23
+ status: 'completed',
24
+ completed: 1,
25
+ total: 1,
26
+ creditsUsed: 1,
27
+ expiresAt: new Date(),
28
+ data: [
29
+ {
30
+ url: 'https://example.com',
31
+ title: 'Test Page',
32
+ description: 'Test Description',
33
+ markdown: '# Test Content',
34
+ actions: null,
35
+ },
36
+ ],
37
+ };
38
+ // Create mock instance methods
39
+ const mockSearch = jest.fn().mockImplementation(async () => mockSearchResponse);
40
+ const mockAsyncBatchScrapeUrls = jest
41
+ .fn()
42
+ .mockImplementation(async () => mockBatchScrapeResponse);
43
+ const mockCheckBatchScrapeStatus = jest
44
+ .fn()
45
+ .mockImplementation(async () => mockBatchStatusResponse);
46
+ // Create mock instance
47
+ const mockInstance = {
48
+ apiKey: 'test-api-key',
49
+ apiUrl: 'test-api-url',
50
+ search: mockSearch,
51
+ asyncBatchScrapeUrls: mockAsyncBatchScrapeUrls,
52
+ checkBatchScrapeStatus: mockCheckBatchScrapeStatus,
53
+ };
54
+ // Mock the module
55
+ jest.mock('@mendable/firecrawl-js', () => ({
56
+ __esModule: true,
57
+ default: jest.fn().mockImplementation(() => mockInstance),
58
+ }));