title: Test object structure with jest
body: <p>I would need some advice, currently I would like to test that every object in an object collection has the correct structure so I do this:</p>
  <pre class="lang-js prettyprint-override"><code>const allExercises = listAllExercises()
  
  describe(&quot;listAllExercises | should return all exercises&quot;, () =&gt; {
    test(&quot;Each exercise should have the right structure&quot;, () =&gt; {
      const keys = [
        &quot;name&quot;,
        &quot;execution&quot;,
        &quot;level&quot;,
        &quot;is_poly_articular&quot;,
        &quot;practice&quot;,
        &quot;gender&quot;,
        &quot;body_focus&quot;,
      ]
  
      allExercises.forEach((exercise) =&gt; {
        expect(Object.keys(exercise).sort()).toEqual(keys.sort())
      })
    })
  })
  </code></pre>
  <p>It works great, but I wanted to know if this was the right way to go, do you have a better solution for testing an object's keys with jest?</p>