Skip to content

Commit

Permalink
fixing jest parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelsideguide committed Apr 18, 2024
1 parent dae024a commit efbb4e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
run: npm run workers &
working-directory: ./apps/api
- name: Run E2E tests
run: npx jest --openHandlesTimeout=60000 -- src/__tests__/e2e/index.test.ts
run: npx jest --openHandlesTimeout=60000 --watchAll=false -- src/__tests__/e2e/index.test.ts
working-directory: ./apps/api


Expand Down
23 changes: 12 additions & 11 deletions apps/api/src/__tests__/e2e/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,20 @@ describe('E2E Tests for API Routes', () => {
expect(response.body).toHaveProperty('status');
expect(response.body.status).toBe('active');

setTimeout(async () => {
const response = await request(TEST_URL)
// wait for 30 seconds
await new Promise((r) => setTimeout(r, 30000));

const completedResponse = await request(TEST_URL)
.get(`/v0/crawl/status/${crawlResponse.body.jobId}`)
.set('Authorization', `Bearer ${process.env.TEST_API_KEY}`);
expect(response.statusCode).toBe(200);
expect(response.body).toHaveProperty('status');
expect(response.body.status).toBe('completed');
expect(response.body).toHaveProperty('data');
expect(response.body.data).toHaveProperty('content');
expect(response.body.data).toHaveProperty('markdown');
expect(response.body.data).toHaveProperty('metadata');
expect(response.body.data.content).toContain('🔥 FireCrawl');
}, 30000); // 30 seconds
expect(completedResponse.statusCode).toBe(200);
expect(completedResponse.body).toHaveProperty('status');
expect(completedResponse.body.status).toBe('completed');
expect(completedResponse.body).toHaveProperty('data');
expect(completedResponse.body.data).toHaveProperty('content');
expect(completedResponse.body.data).toHaveProperty('markdown');
expect(completedResponse.body.data).toHaveProperty('metadata');
expect(completedResponse.body.data.content).toContain('🔥 FireCrawl');
}, 60000); // 60 seconds
});

Expand Down

0 comments on commit efbb4e8

Please sign in to comment.