chai-jest-snapshot
chai-jest-snapshot copied to clipboard
Property matcher support
I understand that this code probably isn't ready to merge yet (e.g., it doesn't have tests or docs), but I wanted to at least open this PR in case others find it helpful.
Basically, it enables Jest 23 with property matchers, which make snapshot testing much more broadly applicable. The property matchers always go as the first argument (including when you're updating a snapshot with to.matchSnaphot(matchers, true)
), and their values must come from the expect
module that jest uses under the hood. I.e.,
import { any } from "expect";
// ...
expect(it).to.matchSnapshot({ id: any(String) })
This PR works great and would be super cool to merge! /cc @suchipi :pray:
Can we get this merged? Also the same for update jest-snapshot
dependency.