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

Đang mở
#4 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
0
Fork
1
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

(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'});
})
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.