I am using mail-listener2 to monitor an email account, as check that an email has been recieved as part of a test.
I have used the same implementation defined here: here:Fetching values from email in protractor test case
However, getLastEmail() returns an old email, rather than an email received after the mail-listener2 has started. It returns the first UNSEEN email.
I've looked at whether I can used different mail-listener2 configurations to solve this, but I haven't found anything. I've also tried to use a .last() on the mail returned, but this hasn't worked either.
Does anyone have a configuration solution, or a custom solution that would help to solve this problem?