forwardemail / forwardemail/supertest
Error after setting "Content-Type" to "multipart/form-data" [ERR_INVALID_ARG_TYPE]
- Dominant language
- JavaScript
- Stars
- 14.4k
- Forks
- 782
- PR merge metrics
- No merged PRs in 30d
Description
hey I was trying to test my express API endpoints as you see below:
```
test('POST: Send registration request', done => {
superTest(Api)
.post('/auth/register')
.set('Content-Type', 'multipart/form-data')
.send(fakeUser)
.expect('Content-Type', 'application/json; charset=utf-8')
.expect(200, done);
});
```
but I got this error after i set `.set('Content-Type', 'multipart/form-data')` :
> TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received an instance of Object
Contributor guide
Assessment
This issue has not been assessed yet.