forwardemail / forwardemail/supertest

attach not upload the file

Open
#647 3 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.