function getOneHit() {
  return {
    objectID: chance.word({length: 10}),
    description: chance.paragraph({sentences: random(1, 3)}),
    popularity: random(1, 100)
  };
}
function getFakeHitsResponse() {
  var nbHits = random(1, 10);

  return {
    statusCode: 200,
    headers: {
      'Content-Type': 'application/json; charset=UTF-8'
    },
    body: {
      hits: getFakeObjects(nbHits),
      nbHits: nbHits,
      page: 0,
      hitsPerPage: 20,
      processingTimeMS: 1
    }
  };
}
function getFakeObjects(max) {
  var nbHits = random(1, max || 10);
  return times(nbHits, getOneHit);
}