You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a common anti-pattern in Protractor when something is explicitly resolved and then asserted instead of passing a promise directly to expect() which is patched to understand promises and resolve them implicitly before making an expectation.
I can imagine that this would not of course catch all the violations of the type, but I think, at the very least, the rule should look that the promise resolution functions argument (text in this case) is not then passed to expect()..
The text was updated successfully, but these errors were encountered:
alecxe
changed the title
Recommend to pass promises to expect() directly if possible
Rule Proposal: Recommend to pass promises to expect() directly if possible
Jul 10, 2016
There is a common anti-pattern in Protractor when something is explicitly resolved and then asserted instead of passing a promise directly to
expect()
which is patched to understand promises and resolve them implicitly before making an expectation.This should issue a warning:
This should be used instead:
I can imagine that this would not of course catch all the violations of the type, but I think, at the very least, the rule should look that the promise resolution functions argument (
text
in this case) is not then passed toexpect()
..The text was updated successfully, but these errors were encountered: