|
|
|
|
|
by ajjenkins
1205 days ago
|
|
I like this. TDD purists would probably complain that you don’t assert a specific value, but in practice I know a lot of people hardcode the assert values for their tests based on the test output. So this just automated that, I guess. If I was looking for a new test framework, I would consider this. |
|
- Snapshot testing is like version-control but for the outputs rather than the inputs (source code).
- Asserts in traditional unit tests are like "block lists" specifying which changes aren't allowed. Instead, snapshot testing allows you to specify an "allow list" of acceptable differences (e.g. timestamps).