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
{{ message }}
This repository was archived by the owner on Oct 17, 2025. It is now read-only.
Mocha has an async-only option to "force all tests to take a callback (async) or return a promise". This is very handy as it protects developers from creating tests that always pass regardless of the expect statements. e.g.:
Always passes:
it('should have a link to Protractor'swebsite',()=>{expect(anchor.getAttribute('href')).toEqual('http://www.protractortest.org/#/');});
Passes whenever the expect statement passes:
it('should have a link to Protractor'swebsite',()=>{returnexpect(anchor.getAttribute('href')).toEqual('http://www.protractortest.org/#/');});
All it takes is that missing return keyword.
I propose adding a feature similar to Mocha's (perhaps even enabled by default) to force each it to receive a done argument or to return a promise.
Or, if possible, it would be great to simply have some kind of lint check that runs to confirm that there aren't any ignored promises.