-
Notifications
You must be signed in to change notification settings - Fork 6.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
feat(learn): add section for dynamically generating test cases #7387
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 |
EDIT: ohhh! Wait, is the experimental API you're concerned about |
Yup and and using a variable is easier because the reader can copy past and run. |
A variable for what? |
import { isBiscuit } from "factory";
const valid_tests_case = [
"cookies",
"speculoos"
];
test("isBiscuit", (t) => {
for() {
// loop for dynamic test
t.test(`${e} - should be true`)
}
}); in this case it's use Biscuit because it's fun But here it's test user agent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to merge whenever the PR becomes ready.
Hmm, I've given this some more thought, and I think the experimental API used is okay because it does not affect the main issue of the article. Thoughts on that? How about both options? The user-agent one is simple, and the glob is advanced; I know I frequently see docs cover a simple example but not an advanced one, which leaves an advanced user on their own to figure out something complicated (which is very frustrating). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ! maybe open an issue after this pr merged to explore the possibility of making one article per use case, as this one is starting to get long.
Lighthouse Results
|
Description
Validation
Related Issues
Check List
npm run format
to ensure the code follows the style guide.npm run test
to check if all tests are passing.npx turbo build
to check if the website builds without errors.