mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
17 lines
469 B
TypeScript
17 lines
469 B
TypeScript
import { addSerializer, toMatchSpecificSnapshot } from 'jest-specific-snapshot';
|
|
import toJson from 'enzyme-to-json';
|
|
|
|
expect(100).toMatchSpecificSnapshot('mySnapshotFile.snap');
|
|
|
|
addSerializer(toJson);
|
|
|
|
function doSomeThing(received: any) {
|
|
return received;
|
|
}
|
|
expect.extend({
|
|
toMatchDecoratedSpecificSnapshot(received, snapshotFile) {
|
|
const data = doSomeThing(received);
|
|
return toMatchSpecificSnapshot.call(this, data, snapshotFile);
|
|
}
|
|
});
|