Jest Inline Snapshots
Jest came out with Snapshot testing a few years back, then a little bit later this was extended to include inline snapshots. I use inline snapshots a lot because I think they get all the advantages of snapshot testing but by having the results inline, you are forced to reckon with the things you test.
Using inline snapshots in style
For a game I'm working on, I use Redux as a state management library [[games/phaser-redux]] and have an extensive Jest test suite around this code because it's all so self-contained. Games are particularly stateful apps, and relying on tests to handle all your logic usually saves a bunch of time because you don't have to get the game back into the same state as before.
Here's an example of the state which is controlled by redux:
ts
This game's state powers a Phaser game engine in production, and has a prototype SVG renderer, but in tests, it also has a text representation. One state, three renderers.
Text rendering
The text rendering is considerably more information dense than the JSON object it represents, and so that is used for snapshots via a custom Jest snapshot serializer: here's the module which sets that up:
ts
So, what does this look like in practice? Here's a test for the pressing the arrow buttons from the keyboard:
ts
Don't think of these tests as a comprehensive test suite, but think of them as a communication pattern between me (as author) and you (or future me) as what should generally happen ([[js/testing-js]]). If this was a formal test suite, there would be it("wraps left"), it("wraps right") etc etc, but instead you see the actions which trigger the change in behavior and it tells an overall story. These are closer to integration tests than unit tests. 
Here's an example unit test which very specifically tests one behaviour:
ts
Snapshots as Story
These tests tell the story of how a system changes in a way that would be hard to describe as a series of individual, isolated tests. The use of inline snapshots just automates the process involved in creating and updating those tests with time.
The inline snapshots are used to help give you a much better idea of the before/after from the test.