I have rewrited the tests for microsoftAuth using jest.fn for callbacks and jest promise API for promises. This made the tests more clear and compact. I have also added the abort option to the listenForCode function to add the possibility to close the server without waiting for code or timeout.
I have rewrited the tests for microsoftAuth using
jest.fn
for callbacks and jest promise API for promises. This made the tests more clear and compact. I have also added theabort
option to thelistenForCode
function to add the possibility to close the server without waiting for code or timeout.