Skip to content

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

Description

@kayleewright-bluescape

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions