igor-dv / jest-specific-snapshot

Jest matcher for multiple snapshot files per test
MIT License
57 stars 15 forks source link

Custom serializers broken #32

Closed shilman closed 3 years ago

shilman commented 3 years ago

I've been using a JSON serializer in https://github.com/storybookjs/storybook/ for some of my test cases:

expect.addSnapshotSerializer({
  print: (val: any) => JSON.stringify(val, null, 2),
  test: (val) => typeof val !== 'string',
});

I've verified this works in standard jest snapshotting, and I'm pretty sure (but not 100% positive) that it used to work in jest-specific-snapshot with older versions of jest. But it's getting ignored with jest@26.x and using the standard Jest serializer.

Help a brother out? 🤷‍♂️

shilman commented 3 years ago

I'm an idiot 🤦

import { addSerializer } from 'jest-specific-snapshot';