There is an error running waitForReact in a node callback instead of a testcafe test due to the ClientFunction not being able to automatically pick up the testController.
ClientFunction cannot implicitly resolve the test run in context of which
it should be executed. If you need to call ClientFunction from the Node.js
API callback, pass the test controller manually via ClientFunction's
.with({ boundTestRun: t }) method first. Note that you cannot execute
ClientFunction outside the test code.
And by allowing an optional argument to pass in the testController it allows people to fix this issue and use it in different use cases (in my case I am using gherkin-testcafe)
There is an error running waitForReact in a node callback instead of a testcafe test due to the ClientFunction not being able to automatically pick up the testController.
Here is the issue as described in the testcafe documentation: https://devexpress.github.io/testcafe/documentation/test-api/selecting-page-elements/selectors/edge-cases-and-limitations.html#calling-selectors-from-nodejs-callbacks
And by allowing an optional argument to pass in the testController it allows people to fix this issue and use it in different use cases (in my case I am using
gherkin-testcafe
)Please let me know if you need any more details.