Error when running "npx folio": First argument must use the object destructuring pattern: _x

Viewed 893

I have playwright tests and I run the tests with this command: npx folio.

But when I run the tests I receive this error message:

First argument must use the object destructuring pattern: _x

I did try to delete the .babelrc file which should work according to this thread. But that didn't change anything for me.

What could be done to address this error?

1 Answers

You would see this error if a function is provided to beforeEach or afterEach and doesn't take an object as its first parameter. So this won't work:

const before = (aFixture) => {...}
test.beforeEach(before);

it needs to be like this:

const before = ({ aFixture }) => {...}
test.beforeEach(before);
Related