Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Fails to convert a test that contains an inner arrow function and incorrectly converts a test that has an inner function

未关闭
#4 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
javascript
领域
tooling

调研方向

首先定位用于识别 Scenario 回调并重写其参数的转换器逻辑,然后复现 issue 中嵌套箭头函数和嵌套函数的示例。当包含内部箭头函数的测试能够完成转换,同时内部函数的参数保持不变时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

(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'});
})
主要语言
JavaScript
星标
0
派生
1
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。