Hello!! I'm doing some testing with MirageJS and React Native, but it is crashing using FormData in requests.
Specifically in the next block of code (pretender.js line 1569) added in this PR #320
if (body instanceof FormData) {
body.forEach(function (value) {
if (value instanceof File) {
totalSize += value.size;
}
else {
totalSize += value.length;
}
});
}
Using console log with body returns these values:
{"_parts": [["grant_type", "password"], ["username", "user@user.com"], ["password", "123456"]]}
Then the app returns an error because body doesn't have a forEach function but it is an instanceof FormData:
TypeError: undefined is not a function (near '...body.forEach...')
scheduleProgressEvent@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:131702:25
Versions:
Pretender: 3.4.6
Axios: 0.21.1
MirageJS: 0.1.41
React Native: 0.63.4
Hello!! I'm doing some testing with MirageJS and React Native, but it is crashing using FormData in requests.
Specifically in the next block of code (pretender.js line 1569) added in this PR #320
Using console log with body returns these values:
Then the app returns an error because body doesn't have a forEach function but it is an instanceof FormData:
Versions: