{"action":"closed","issue":{"url":"https://api.github.com/repos/recruit-tech/agreed-core/issues/60","repository_url":"https://api.github.com/repos/recruit-tech/agreed-core","labels_url":"https://api.github.com/repos/recruit-tech/agreed-core/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/recruit-tech/agreed-core/issues/60/comments","events_url":"https://api.github.com/repos/recruit-tech/agreed-core/issues/60/events","html_url":"https://github.com/recruit-tech/agreed-core/issues/60","id":334423074,"node_id":"MDU6SXNzdWUzMzQ0MjMwNzQ=","number":60,"title":"レスポンスステータスのみを返すAPIのステータスが異なっていてもfailしない","user":{"login":"k-minemoto","id":1562988,"node_id":"MDQ6VXNlcjE1NjI5ODg=","avatar_url":"https://avatars3.githubusercontent.com/u/1562988?v=4","gravatar_id":"","url":"https://api.github.com/users/k-minemoto","html_url":"https://github.com/k-minemoto","followers_url":"https://api.github.com/users/k-minemoto/followers","following_url":"https://api.github.com/users/k-minemoto/following{/other_user}","gists_url":"https://api.github.com/users/k-minemoto/gists{/gist_id}","starred_url":"https://api.github.com/users/k-minemoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k-minemoto/subscriptions","organizations_url":"https://api.github.com/users/k-minemoto/orgs","repos_url":"https://api.github.com/users/k-minemoto/repos","events_url":"https://api.github.com/users/k-minemoto/events{/privacy}","received_events_url":"https://api.github.com/users/k-minemoto/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-21T10:01:15Z","updated_at":"2018-07-18T12:02:38Z","closed_at":"2018-07-18T12:02:38Z","author_association":"CONTRIBUTOR","body":"```:javascript\r\n// agreed.js\r\nmodule.exports = [\r\n{\r\n  request: {\r\n    path: '/api/sample/:id',\r\n    method: 'PUT',\r\n    body: [\r\n      {value:'test'}\r\n    ],\r\n    values: {\r\n      id: 1,\r\n    },\r\n  },\r\n  response: {\r\n    status: 204,\r\n  },\r\n}]\r\n```\r\nクライアントテストの実行\r\n```:bash\r\n$ agreed-client --host localhost --port 8080 --path ./agreed.js\r\n```\r\n\r\nこの時、実際のサーバーステータスが200で戻ってきても、テスト結果がOKとなります。\r\n\r\nhttps://github.com/recruit-tech/agreed-client/blob/master/lib/reporter.js#L15\r\nを見る限りではdiffかschemaErrorsのどちらかにデータがあるとfailするようになってますが、この時のresultの中身は\r\n```:javascript\r\n{ body: '', diff: {}, status: [ 204, 200 ] }\r\n```\r\nとなっており、failと判定されません（※isEmpty(result)は、diffが存在するので常にfalseです）。\r\nよって詰め込む側がdiffに入れるかreporter側がstatusの有無を見るかになりますが、単純にclientのcheckResponseの処理でdiffに入れ損ねているように見えます。\r\n"}}
{"actor":{"display_login":"yosuke-furukawa"}}