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

オープン
#4 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
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'});
})
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。