digitalbazaar / web-ledger-client

An implementation of a a Web Ledger client
BSD 3-Clause "New" or "Revised" License
5 stars 2 forks source link

Remove api sauce #25

Closed aljones15 closed 3 years ago

aljones15 commented 3 years ago

My apologies about how long this has taken, but there were a few interesting things that came up during this PR.

  1. when nock returns a 400 http response @digitalbazaar/http-client adds the resulting data to the error object and not the error.response object. (this is probably the case with real requests too)
  2. When sending to the ledgerQueryService we were using the form query/?id='foo' this is fine as express treats that url as equivalent to query?id=foo, but I changed the tests and the path to match the documented route in bedrock-ledger-agent
  3. bedrock-ledger-agent already does end tests using the form query?id='foo' I tested it with /?id and without and it worked with either path.
  4. jsonld headers were added to tests that return jsonld
  5. nock was upgraded so that when using reply it will set a content-type from the response body if no content-type is provided.