title: How can I test part of object using Jest?
body: <p>I would like to test that time is parsed correctly and I am only interested in checking some of the properties and not the entire object. In this case hour and minutes. </p>
  
  <p>I tried using <code>expect(object).toContain(value)</code> but as you can see in the snippet below it fails although the object contains the properties I am interested in and they have the correct value.  </p>
  
  <pre><code>● Calendar &gt; CalendarViewConfig › it should parse time
  
  expect(object).toContain(value)
  
  Expected object:
    {"display": "12:54", "full": 774, "hour": 12, "hours": 12, "minutes": 54, "string": "12:54"}
  To contain value:
    {"hours": 12, "minutes": 54}
  
    67 |   it('it should parse time', () =&gt; {
    68 |     ...
  &gt; 69 |     expect(parseTime('12:54')).toContain({ hours: 12, minutes: 54})
    70 |   })
  
    at Object.&lt;anonymous&gt; (src/Components/Views/Calendar/CalendarViewConfig.test.js:69:32)
  </code></pre>