Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kayleewright-bluescape opened this issue Mar 18, 2021 · 0 comments

Comments

@kayleewright-bluescape
Copy link

(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'});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant