codeceptjs / codeceptjs/codecept3-upgrade
Fails to convert a test that contains an inner arrow function and incorrectly converts a test that has an inner function
- 主要语言
- JavaScript
- 星标
- 0
- 派生
- 1
- PR 合并指标
- 30 天内没有已合并 PR
描述
(Note the examples below are not my actual tests but the simplest form in which I could repo the issue.)
**Problem:**
1. If my test contains an inner arrow function like `() => {}` or `() => returnValue` then the converter does not identify the test as one needing updates.
2. If my test contains an inner function like `function(arg1) {return returnValue}` then the converter converts the args of the inner function too! (which isn't correct)
**Arrow function example:**
```
Scenario('myTest', async function (I) {
const myList = ['#1', '#2', '#3'];
myList.forEach((x) => '1');
})
```
_Output_:
1 unmodified
(no change to test)
**function example:**
```
Scenario('myTest', async function (I) {
const myList = ['#1', '#2', '#3'];
myList.forEach(function (x) {return '1'});
})
```
_Output_:
1 ok
```
Scenario('myTest', async function ({ I }) {
const myList = ['#1', '#2', '#3'];
myList.forEach(function ({ x }) {return '1'});
})
```
贡献指南
这个仓库没有索引到贡献指南
调研方向
首先定位用于识别 Scenario 回调并重写其参数的转换器逻辑,然后复现 issue 中嵌套箭头函数和嵌套函数的示例。当包含内部箭头函数的测试能够完成转换,同时内部函数的参数保持不变时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- tooling
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100