ekino / veggies

:sparkles: :rocket: Veggies is an awesome cucumberjs library for API/CLI testing. Great for testing APIs built upon Express, Koa, HAPI, Loopback and others. It's also the perfect companion for testing CLI applications built with commander, meow & Co.
https://ekino.github.io/veggies/
MIT License
90 stars 18 forks source link

Add multipart #27

Closed mnishizawa closed 6 years ago

mnishizawa commented 6 years ago

Adds support for multipart forms for file upload via a service call.

Note: a lot of the files here are simply reformatted though I didn't touch them and never opened them. Not sure if that is happening in the precommit hooks but I thought I would bring it up that I did not reformat those files.

I don't see any other test frameworks for apis that support multipart form submission for file upload.

Test plan Definition test has been added to the rest of the definitions tests.

When I use the step definition, "[I ]set request multipart body from ", the request will create a request for a multipart form submission.

Sample fixture:

'use strict'

const fs = require('fs')

module.exports = () => ({
    "errorLog" : fs.createReadStream(__dirname+"/sampleErrorFile.txt.zip")
})
plouc commented 6 years ago

@mnishizawa, thank you for this contribution, for the updated files you didn't touched, that's probably because you're using npm instead of yarn, this repo provides a yarn.lock. There's a git hook which format files, because npm didn't used lock file, you may have a different prettier version which formatted code differently. Is it possible that you switch to yarn and re-format the code please?

mnishizawa commented 6 years ago

When I commit the husky hooks appear to still be running npm. Is there something I need to do to tell it to run yarn instead?

plouc commented 6 years ago

Sorry, I meant just running the install through yarn, npm should be fine after that, it's just to lock deps.

mnishizawa commented 6 years ago

Ok, files should be updated now, one of the snapshot tests failed. Any guidance on how I may have affected that test since I didn't change anything in the snapshots extension?

plouc commented 6 years ago

Fail was due to a timeout, just restarted it, and it passed.

mnishizawa commented 6 years ago

Cool. Anything else you would like me to fix or change?

plouc commented 6 years ago

Nope, LGTM, thank you!