feat(learn): add section for dynamically generating test cases#7387
feat(learn): add section for dynamically generating test cases#7387JakobJingleheimer merged 4 commits intomainfrom
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 |
ovflowd
left a comment
There was a problem hiding this comment.
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). |
AugustinMauroy
left a comment
There was a problem hiding this comment.
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 formatto ensure the code follows the style guide.npm run testto check if all tests are passing.npx turbo buildto check if the website builds without errors.