Try adding the following to the invalid section of unit tests:
['function withLoop() { return () => { for (i = 0; i < 5; i++) {}}}', 'const withLoop = () => () => { for (i = 0; i < 5; i++) {}};']
The test will fail because produced code will look like this:
const withLoop = () => () => { for (i = 0; i < 5i++) {}};
The second semicolon is removed which leads to syntax error in the code.
Try adding the following to the invalid section of unit tests:
['function withLoop() { return () => { for (i = 0; i < 5; i++) {}}}', 'const withLoop = () => () => { for (i = 0; i < 5; i++) {}};']
The test will fail because produced code will look like this:const withLoop = () => () => { for (i = 0; i < 5i++) {}};
The second semicolon is removed which leads to syntax error in the code.