lundi 21 août 2017

ReferenceError: btoa is not defined at avajs

I am trying to do my authActions.test.js to test my authActions from Redux.

I am using Avajs, Enzyme and Jsdom.

The action that I am testing is basically a post to make user authentication and inside my headers I have the function btoa.

When I run this test I got the error:

 ✖ Login User Promise returned by test never resolved
Unhandled Rejection: app/test/js/actions/authActions.test.js

How can I mock the btoa function?

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire