Multiple stubbings with throwException causes unexpected behavior
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
- 领域
- testing
调研方向
Start by reproducing the two-stubbing example in the issue and review the related issue #180. Trace how matching stubbings are selected when the first uses thenThrow and the second uses thenReturn. Done means the observed behavior is resolved or a verified workaround is documented.
由索引模型根据 Issue 内容生成。
描述
When you set two stubbings that match the same invocation with the first stubbing calling throwException declaring the second stubbing trigger the exception of the first stubbing.
Example :
td.when(dep()).thenThrow(new Error())
td.when(dep()).thenReturn(true)
Executing the above code will throw an error of type Error.
I think it relates to this issue. Not sure if it can be fixed in testdouble but is there at least a workaround ?
- 主要语言
- JavaScript
- 星标
- 1.4k
- 派生
- 141
- 平均合并
- 12 分钟
- 30 天内合并 PR
- 7
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
testdouble/testdouble.js 的其他 Issue
-
Feature request: `td.func().reset()` (reset spy/stub state)可能已有人在做 @MatrixNeoKozak 于 13 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 45/100
testdouble/testdouble.js#529 ·
-
难度 2/5 1-3 小时 新手友好度 35/100
testdouble/testdouble.js#296 ·
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
testdouble/testdouble.js#281 · 5 条评论 · 2 个 reaction ·
-
难度 5/5 一周以上 新手友好度 25/100
testdouble/testdouble.js#276 ·
-
难度 4/5 3-5 天 新手友好度 35/100
testdouble/testdouble.js#275 · 3 条评论 ·
查看 testdouble/testdouble.js 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
glossyio/traffic-monitor#255 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
juice-shop/juice-shop#3706 ·
维护者通常 1 天内回复
-
Main workflow runs twice for newly created refs可能已有人在做 @rustyconover 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
duckdb/duckdb-wasm#2293 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
521xueweihan/HelloGitHub#4115 ·
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
outline/outline#14348 · 1 条评论 ·
维护者通常 1 天内回复