Skip to content
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

docs: corrected example code of fetch API mocking in test runner. #7492

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

bilalshareef
Copy link
Contributor

The current example code throws TypeError [Error]: Invalid URL at new URL (node:internal/url:816:29) error when ran.
The correct usage for MockAgent.get() API of undici is to pass the base URL with the protocol(https, http, etc).

Description

Validation

Related Issues

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run npm run format to ensure the code follows the style guide.
  • I have run npm run test to check if all tests are passing.
  • I have run npx turbo build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

docs: corrected example code of fetch API mocking.

Signed-off-by: Mohammed Bilal Shareef <[email protected]>
@bilalshareef bilalshareef requested a review from a team as a code owner February 12, 2025 18:47
Copy link

vercel bot commented Feb 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Feb 12, 2025 6:49pm

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT !

Copy link
Member

@araujogui araujogui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

benhalverson added a commit to benhalverson/nodejs.org that referenced this pull request Feb 16, 2025
Copy link
Contributor

@shanpriyan shanpriyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

github-actions bot commented Feb 17, 2025

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 98 🟢 100 🟢 100 🟢 91 🔗
/en/about 🟢 100 🟢 100 🟢 100 🟢 91 🔗
/en/about/previous-releases 🟢 100 🟢 100 🟢 100 🟢 92 🔗
/en/download 🟢 90 🟢 100 🟢 100 🟢 91 🔗
/en/blog 🟢 100 🟢 100 🟢 96 🟢 92 🔗

Copy link
Contributor

Unit Test Coverage Report

Lines Statements Branches Functions
Coverage: 90%
88.71% (739/833) 76.1% (242/318) 87.65% (142/162)

Unit Test Report

Tests Skipped Failures Errors Time
182 0 💤 0 ❌ 0 🔥 5.711s ⏱️

@AugustinMauroy AugustinMauroy added this pull request to the merge queue Feb 17, 2025
Merged via the queue into nodejs:main with commit 10c21c4 Feb 17, 2025
15 of 16 checks passed
@bilalshareef bilalshareef deleted the test-runner-docs branch February 21, 2025 10:48
github-merge-queue bot pushed a commit that referenced this pull request Feb 24, 2025
* feat: added new learn section with fetch examples

#7492

* updated code example and added to sidebar

* docs: updated example code

* docs: Updated example to use mistral and typo fix

* docs: spelling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants