Skip to content
Advertisement

Testcafe filter function

I have a filter function for Selector as following which accepts two parameters { subject: subject, from: from } as a dependencies object.

But after running this function, I am getting an error

ReferenceError: subject is not defined

JavaScript

Can TestCafe team please help me with this?

Advertisement

Answer

In the case of the .filter method you need to rewrite your dependencies parameter ({ dependencies: { subject: subject, from: from } }) as follows:

JavaScript

I have prepared a sample test to illustrate it:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement