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

Add mocking guide #7092

Merged
merged 8 commits into from
Oct 8, 2024
Merged

Add mocking guide #7092

merged 8 commits into from
Oct 8, 2024

Conversation

JakobJingleheimer
Copy link
Contributor

Description

Add a guide for when, why, and how to mock in tests via node built-ins

Validation

Read the article :)

Related Issues

None

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.

Copy link

vercel bot commented Oct 6, 2024

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

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Oct 8, 2024 0:27am

@AugustinMauroy
Copy link
Contributor

AugustinMauroy commented Oct 6, 2024

On first reading, it seems like a good direction to me. But I think adding a paragraph explaining the concept of ‘mock’ would be useful, as the learn section is supposed to be more explanatory than the API docs, which are very technical.

I also noticed that there is no link to the mock docs API, which could be very useful.

apps/site/pages/en/learn/test-runner/mocking.md Outdated Show resolved Hide resolved
apps/site/pages/en/learn/test-runner/mocking.md Outdated Show resolved Hide resolved
apps/site/pages/en/learn/test-runner/mocking.md Outdated Show resolved Hide resolved
apps/site/pages/en/learn/test-runner/mocking.md Outdated Show resolved Hide resolved
apps/site/pages/en/learn/test-runner/mocking.md Outdated Show resolved Hide resolved
apps/site/pages/en/learn/test-runner/mocking.md Outdated Show resolved Hide resolved
apps/site/pages/en/learn/test-runner/mocking.md Outdated Show resolved Hide resolved
Copy link
Member

@RedYetiDev RedYetiDev left a comment

Choose a reason for hiding this comment

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

Regardless of whether the rest of the nitpicks are added, it reads well, so LGTM.

The other members of @nodejs/test_runner might wanna take a look tho.

Copy link
Contributor

@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.

LGTM ! Thanks to improve learn section

@JakobJingleheimer
Copy link
Contributor Author

Thanks @aduh95 @AugustinMauroy @RedYetiDev !

I think it's ready to go, baring any requests from others on the test runner team. I'll wait a day to give them a chance to chime in.

Copy link
Member

@mcollina mcollina 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

github-actions bot commented Oct 8, 2024

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🔴 67 🟢 100 🟢 100 🟢 91 🔗
/en/about 🟢 100 🟢 100 🟢 100 🟢 91 🔗
/en/about/previous-releases 🟢 99 🟢 100 🟢 100 🟢 92 🔗
/en/download 🟢 100 🟢 100 🟢 100 🟢 91 🔗
/en/blog 🟢 100 🟢 100 🟢 100 🟢 92 🔗

Copy link

github-actions bot commented Oct 8, 2024

Unit Test Coverage Report

Lines Statements Branches Functions
Coverage: 92%
90.47% (589/651) 76.29% (177/232) 94.35% (117/124)

Unit Test Report

Tests Skipped Failures Errors Time
131 0 💤 0 ❌ 0 🔥 5.287s ⏱️

JakobJingleheimer and others added 8 commits October 8, 2024 07:20
Co-authored-by: Augustin Mauroy <augustin.mauroy@outlook.fr>
Co-authored-by: Aviv Keller <redyetidev@gmail.com>
Signed-off-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
Co-authored-by: Aviv Keller <redyetidev@gmail.com>
Signed-off-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
…ith `bar`)

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Signed-off-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
@bmuenzenmeyer
Copy link
Collaborator

pushed a rebase

@bmuenzenmeyer bmuenzenmeyer added the github_actions:pull-request Trigger Pull Request Checks label Oct 8, 2024
@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label Oct 8, 2024
@JakobJingleheimer JakobJingleheimer added this pull request to the merge queue Oct 8, 2024
Merged via the queue into main with commit bfae4b9 Oct 8, 2024
15 checks passed
@JakobJingleheimer JakobJingleheimer deleted the art/mocking branch October 8, 2024 13:02
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.

7 participants