openservicebrokerapi / osb-checker

An automatic checker to verify an Open Service Broker API implementation against the specification
https://github.com/openservicebrokerapi/servicebroker/
Apache License 2.0
48 stars 40 forks source link

Fix JSON parse error in poll last operation scenario #39

Closed leonwanghui closed 6 years ago

leonwanghui commented 6 years ago

Signed-off-by: leonwanghui wanghui71leon@gmail.com

Problem description

When I first try npm test for mock broker, it seems that there is one use case that always fail with errors below:

  85 passing (214ms)
  1 failing

  1) PATCH /v2/service_instance/:instance_id
       UPDATE
         should accept a valid update request:
     Uncaught SyntaxError: Unexpected token a in JSON at position 1
      at JSON.parse (<anonymous>)
      at testLastOperationStatus (test/test.js:233:38)
      at Test.<anonymous> (test/test.js:265:29)
      at Test.assert (node_modules/supertest/lib/test.js:181:6)
      at assert (node_modules/supertest/lib/test.js:131:12)
      at node_modules/supertest/lib/test.js:128:5
      at Test.Request.callback (node_modules/superagent/lib/node/index.js:706:12)
      at parser (node_modules/superagent/lib/node/index.js:906:18)
      at IncomingMessage.res.on (node_modules/superagent/lib/node/parsers/json.js:19:7)
      at endReadableNT (_stream_readable.js:1086:12)
      at process._tickCallback (internal/process/next_tick.js:63:19)

Proposed solution

To solve the problem, I modified one line in test.js and then it works fine.

Please notice that this patch could have impact on #32 .

cfdreddbot commented 6 years ago

Hey leonwanghui!

Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA.

leonwanghui commented 6 years ago

@duglin @mattmcneeney Please take a review, thx!

leonwanghui commented 6 years ago

Any update on this PR? I see there are already 2 committers approved : )

mattmcneeney commented 6 years ago

@leonwanghui good point! I think pullapprove is failing to spot the approvals. Let me try to fix this now...

mattmcneeney commented 6 years ago

@fmui please could you do your approval again now that pullapprove is fixed!