forwardemail / forwardemail/supertest
attach not upload the file
- Dominant language
- JavaScript
- Stars
- 14.4k
- Forks
- 782
- PR merge metrics
- No merged PRs in 30d
Description
I try to test a file upload endpoint but the file not upload in test, this is my test code
```
describe("Add Foto", function() {
it('Se agrega una foto a nueva persona', (done) => {
authenticatedUser.post(endpoint.concat('foto'))
.set('Authorization', 'Bearer '.concat(credentialValues.token))
.attach('file', 'test/uploadFile.txt', {contentType: 'txt'})
.then((res) => {
const body = res.body;
// expect(body).to.contain.property('result');
// let flag = isNaN(body.result);
// expect(flag).to.be.false;
done();
})
.catch((err) => done(err));
});
});
```
the back-end function was called but the file never coming
Please, can someone help me?
Contributor guide
Assessment
This issue has not been assessed yet.