mcollina/autocannon

expectBody not working as expected

オープン

#457 opened on 2022/07/29

 (11 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (332 件のフォーク)batch import
bughelp wanted

Repository metrics

Stars
 (7,425 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Hi @mcollina my version "autocannon": "^7.9.0", my codebase

let customResponse= customResponse

  url: 'http://localhost:3011/employees/api/searchtype/',
  amount: 10,
  connections: 1,
  pipelining: 1,
  //duration: 60,
  method: "POST",
  debug: true,
  expectBody: customResponse,
  headers: { "Content-Type": "application/json; charset=UTF-8", 'x-access-token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2NTkxMjMxMTd9.xavjahsbNggTSDBu6Vmsxzz6olPMXHTPggkFForZqaU' },
  body: JSON.stringify(customRequest),

}, (err, result) => {

  console.log(err);
  if (err != null) return; // or do some error handling
  handleResults(result);
})

The response which i am getting from api response is below API Response

and when I compare it http://www.jsondiff.com/ it was identical Problem statement

when i run the above i am getting mismatched results which should not happen if both the customResponse and API Response are identical

Any pointers on how to tackle this issue

コントリビューターガイド