homeassistant-elasticsearch icon indicating copy to clipboard operation
homeassistant-elasticsearch copied to clipboard

Improve Test Coverage to 97+%

Open strawgate opened this issue 1 year ago • 1 comments

We should investigate and outline a plan to refactor tests to:

  1. Target more, smaller, unit tests
  2. Implement Pytest Snapshot functionality and convert most (if not all) document reference comparisons to just using snapshots
  3. Identify and document a plan to improve test coverage in each component

I'll use this document to track progress

strawgate avatar Apr 22 '24 15:04 strawgate

Implement Pytest Snapshot functionality and convert most (if not all) document reference comparisons to just using snapshots

If we plan to eventually contribute this upstream to Home Assistant, then we should follow their guidance for snapshot testing first-party components. More specifically, we need to use the same library that they do:

Snapshot testing in Home Assistant is built on top of Syrupy, their documentation can thus be applied when writing Home Assistant tests.

legrego avatar Apr 23 '24 12:04 legrego