import canvasSerializer from 'jest-canvas-snapshot-serializer';
expect.addSnapshotSerializer(canvasSerializer);
it('works with canvas', () => {
const canvas = createCanvas('#000', '#F00'); // function from your example.
expect(canvas).toMatchSnapshot();
});
According to the documentation the snapshot should contain a hash, but when I try the example this is my result:
My test code:
Am I missing something?