If we can implement this feature, users of emotion will be able to use these utils as well.
expect.addSnapshotSerializer(serializer)
expect.extend(matcher)
expect.addSnapshotSerializer(serializer(sheet))
expect.extend(matcher)
This is the reason I had to fork https://github.com/kentcdodds/jest-glamor-react for the utils.
See my issue in that repo https://github.com/kentcdodds/jest-glamor-react/issues/5. I couldn't figure out how to do this without changing the api. We do not have that restriction in the repo so it can be accomplished in whatever way that works.
I think this is actually possible without breaking the api.
https://github.com/mitchellhamilton/jest-glamor-react/blob/master/src/serializer.js
I'll probably open a PR once I write tests and fix it up a bit.
That's been merged and will be released in a minute. Enjoy!
@kentcdodds thank you for keeping us updated.
I will port the tests over after #23 is merged.
Most helpful comment
That's been merged and will be released in a minute. Enjoy!