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

feat(learn): add section for dynamically generating test cases #7387

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

JakobJingleheimer
Copy link
Member

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.

@JakobJingleheimer JakobJingleheimer added content Issues/pr concerning content learn Issues/pr concerning the learn section labels Jan 5, 2025
@JakobJingleheimer JakobJingleheimer requested a review from a team as a code owner January 5, 2025 15:29
Copy link

vercel bot commented Jan 5, 2025

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

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Jan 5, 2025 3:32pm

@AugustinMauroy
Copy link
Member

I'm not fan of the provided example because it's based on experimental api.

maybe do same things as this test (do with jest). But I mean based on hand written variable
https://github.com/nodejs/nodejs.org/blob/main/apps/site/util/__tests__/detectOS.test.mjs

@JakobJingleheimer
Copy link
Member Author

JakobJingleheimer commented Jan 5, 2025

Hmm, I think that example isn't quite as good. The one I have is unknowable.

I'm happy to just switch the assertion (and far less work 😅)

EDIT: ohhh! Wait, is the experimental API you're concerned about globSync? (Rather than assert.partialDeepStrictEqual)

Comment on lines +89 to +92
assert.partialDeepStrictEqual(pjson.keywords, [
'node.js',
'sliced bread',
]);
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
assert.partialDeepStrictEqual(pjson.keywords, [
'node.js',
'sliced bread',
]);
assert.match(pjson.name, /@nodejs\/[a-z \-]+/);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Issues/pr concerning content learn Issues/pr concerning the learn section
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants