Document better the details of aync methods
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 45/100
- Issue 类型
- 文档
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, typescript
调研方向
先从 src/wait-for.js 和链接的 dom-testing-library/api-async 页面开始,然后将现有的 waitFor 文档与 issue 中关于 interval 和 timeout 的问题进行对比。完成的标准是:该页面对两个选项的行为作出足够清晰的解释,以解决 flaky 示例,并帮助读者理解时序。
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
In the example seen at the bottom of this issue, I get flaky results. The assertion passes sometimes and fails sometimes. This comes from a lack of understanding by me of how async methods work. I've Googled the heck out of it and read the docs linked below a bunch of times. I also looked through the source code, but I found it to be difficult to understand from someone who hasn't worked in this project.
Describe the solution you'd like
Ultimately, I think there are a couple of waitFor options that should be documented in more detail. I'd like the below questions to be answered.
- What is the behavior of
intervaloption? - What is the behavior of the
timeoutoption?
I think this should be covered in detail here: https://testing-library.com/docs/dom-testing-library/api-async/
Describe alternatives you've considered A clear and concise description of
any alternative solutions or features you've considered.
NA
Additional context Add any other context or screenshots about the feature
request here.
Example code that has flaky results. I don't think the details of useDataFetch is important here, but let me know if I can answer any questions about it.
it('displays fetched data', async () => {
const increment = createIncrement();
const MyComponent = () => {
const { data } = useDataFetch(async () => {
await sleep(1);
return increment();
});
return <div>times fetch called: {data}</div>;
};
render(<MyComponent />);
const element = await screen.findByText('times fetch called: 2');
expect(element).toBeInTheDocument();
});
- 主要语言
- JavaScript
- 星标
- 479
- 派生
- 738
- 平均合并
- 5 天 1 小时
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
testing-library/testing-library-docs 的其他 Issue
-
Broken Chrome Extension Link in Queries Docs可能已有人在做 @rajanpanth 于 59 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 72/100
testing-library/testing-library-docs#1499 ·
维护者通常 4 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
testing-library/testing-library-docs#1528 ·
维护者通常 4 天内回复
-
Framework wrappers and DOM testing library可能已有人在做 @jacklaurencegaray 于 421 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 38/100
testing-library/testing-library-docs#1493 · 3 条评论 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 55/100
testing-library/testing-library-docs#1486 · 1 个 reaction ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 48/100
testing-library/testing-library-docs#1485 · 1 条评论 ·
维护者通常 4 天内回复
查看 testing-library/testing-library-docs 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
woocommerce/woocommerce-google-analytics-integration#699 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
t0ggles
难度 2/5 1-3 小时 新手友好度 70/100
nolimits4web/swiper#8240 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 62/100
Inter-Actief/amelink#131 ·