mcollina/autocannon

expectBody not working as expected

Ouverte

#457 ouverte le 29 juil. 2022

 (11 commentaires) (0 réaction) (0 personne assignée)JavaScript (332 forks)batch import
bughelp wanted

Métriques du dépôt

Stars
 (7 425 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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

Guide contributeur