Open jhalborg opened 7 years ago
Maybe inspiration can be found here https://github.com/RealOrangeOne/react-native-mock/blob/master/src/Libraries/Network/FormData.js
@jhalborg do you mind sharing how you ended up testing FormData
?
I never did, ended up skipping those tests, deadlines being deadlines. I posted a question on SO as well that received an answer recently, but haven't had time to test - maybe you are Marklar on SO? :-)
Thanks for taking the time to reply. Yep, that's me on SO. I'll continue the discussion on SO with the person who provided an answer.
@MrHubble Did you ever figure out what was going wrong?
@jefflau in the Stackoverflow question mentioned above I commented:
Adding global.FormData =
... before importing any other library did not work for me. What did end up working was:
jest.mock('react-native-aws3', () => { return { Request: { FormData: {} } } });.
I'm not sure if this is the right thing to do as it appears I'll have to do it for a number of my dependencies
Can't use the lib for testing FormData bodies it seems - getting
FormData is not defined
.