I would like to test how an REST API handles a POST request that has a body with invalid JSON syntax, for example a missing comma. I'm using node.js to write the API tests. I using frisby but I also tried superagent. No luck. With the previous tools, you pass the request body as a JavaScript object, so it's no go. I tried also to pass the invalid JSON as a string without any luck, since a string is also valid JSON. Any ideas?
Aucun commentaire:
Enregistrer un commentaire