-
-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✅ test: add unit test for packages/web-crawler/src/crawImpl/browserless.ts #6834
base: main
Are you sure you want to change the base?
✅ test: add unit test for packages/web-crawler/src/crawImpl/browserless.ts #6834
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
👍 @gru-agent[bot] Thank you for raising your pull request and contributing to our Community |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6834 +/- ##
==========================================
+ Coverage 91.35% 97.57% +6.22%
==========================================
Files 728 14 -714
Lines 68388 3676 -64712
Branches 3106 205 -2901
==========================================
- Hits 62475 3587 -58888
+ Misses 5913 89 -5824
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
✅ Rebase TestGru PR Success
|
🔄 Rebasing Testgru per ... |
✅ Rebase TestGru PR Success
|
4b87016
to
94a960c
Compare
🔄 Rebasing Testgru per ... |
94a960c
to
6425efc
Compare
1c8f9a2
to
06f7804
Compare
❌ Rebase test pr failed: Error: Pull request #6834 has conflicts. you can use |
🔄 Rebasing Testgru per ... |
Trigger Info
Summary
This PR introduces unit tests for the
browserless
function in theweb-crawler
package. The tests cover various scenarios to ensure the function behaves as expected under different conditions. Key highlights include:Environment Variable Validation: Tests to ensure the function throws an error when required environment variables (
BROWSERLESS_URL
orBROWSERLESS_TOKEN
) are missing.Error Handling: Verifies that the function returns
undefined
when:The fetch request fails.
The fetched content is empty.
The page title is "Just a moment...".
Successful Crawl: Confirms that the function returns the correct crawl result when the fetch is successful and the content is valid.
Request Parameters: Ensures the function makes requests with the correct parameters, including the default
BROWSERLESS_URL
when not explicitly set in the environment variables.These tests improve the reliability and robustness of the
browserless
function by validating its behavior across a range of edge cases and normal operations.Tip
You can
@gru-agent
and leave your feedback. TestGru will make adjustments based on your inputTip
You can
@gru-agent rebase
to rebase the PR.Tip
You can
@gru-agent redo
to reset or rebase before redoing the PR.Tip
To modify the test code yourself, click here Edit Test Code