showing results for - "supertest multipart 2fform data"
Ibtissem
22 Nov 2017
1const res = await request(app)
2  .post('/api/auth/register')
3  .field('name', userData.name)
4  .field('email', userData.email)
5  .field('password', userData.password)
6  .field('personalInformation[firstName]', personalInformation.firstName)
7  .field('personalInformation[lastName]', personalInformation.lastName)
8  .field('personalInformation[birtDate]', personalInformation.birtDate)
9  .field('personalInformation[bornDate]', personalInformation.bornDate)
10  .field('personalInformation[address]', personalInformation.address)
11  .field('workExperinces[0][companyName]', workExperinces.companyName)
12  .field('workExperinces[0][jobsPosition]', workExperinces.jobsPosition)
13  .field('workExperinces[0][startWork]', workExperinces.startWork)
14  .field('workExperinces[0][endWork]', workExperinces.endWork)
15  .field('workExperinces[0][jobsDescription]', workExperinces.jobsDescription)
16  .attach('photo', readPhoto)
17  .attach('document', readDocument)
18  .set('Content-Type', 'multipart/form-data')