Run Functional Tests on API Endpoints using Chai-HTTP(Suggestion)

Hi there, after stuck on "
Run Functional Tests on API Endpoints using Chai-HTTP" Part1-Part4 in Quality Assurance and Testing with Chai for about 3 hours.

I spotted that the problem I encountered come from the way response JSON from GET request of route ‘/_api/get-tests’ is formatted.


responseObj : {
    title: 'send {surname: "Colombo"}',
      "Functional Tests -> Integration tests with chai-http -> PUT /travellers",
    state: "passed",
    assertions: [
        method: "equal",
        args: ["res.status", "200", '"response status should be 200"'],
      { method: "equal", args: ["res.type", '"application/json"'] },
      { method: "equal", args: ["", '"Cristoforo"'] },
      { method: "equal", args: ["res.body.surname", '"Colombo"'] },

As you can see from example
responseObj.assertion[1].args[1] is String which value is “application/json” this will not pass the test because it have to specifically be ‘application/json’ to passed.

So I think , in my opinion, both single quote and double quote should be acceptable for use to pass the test.

Sorry if I missed anything of notice that is reason behind this strict rule.

Thanks, Ron

Here is the link to the response JSON from my glitch(The failed one) that I mentioned :

Hello there,

This is a known issue, and a PR is in queue to solve it: