title: Is there an Array equality match function that ignores element position in jest.js?
body: <p>I get that <code>.toEqual()</code> checks equality of all fields for plain objects:</p>
  <pre class="lang-js prettyprint-override"><code>expect(
      {&quot;key1&quot;:&quot;pink  wool&quot;,&quot;key2&quot;:&quot;diorite&quot;}
  ).toEqual(
      {&quot;key2&quot;:&quot;diorite&quot;,&quot;key1&quot;:&quot;pink wool&quot;}
  );
  </code></pre>
  <p>So this passes.</p>
  <p>But the same is not true for arrays:</p>
  <pre class="lang-js prettyprint-override"><code>expect([&quot;pink wool&quot;, &quot;diorite&quot;]).toEqual([&quot;diorite&quot;, &quot;pink wool&quot;]);
  </code></pre>
  <p>There does not seem to be a matcher function that does this in the jest docs, i.e. that tests for the equality of two arrays irrespective of their elements positions. Do I have to test each element in one array against all the elements in the other and vice versa? Or is there another way?</p>