Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

chai-snapshots

chrismcleod11ISC1.0.7TypeScript support: included

Snapshot generator and matcher for chai

readme

chai-snapshots

Snapshot generator and matcher for chai

Example Useage

// helper.js
import * as snapshots from "chai-snapshots";

chai.use(snapshots.SnapshotMatchers({ 
  pathToSnaps: "./src/tests/snaps.json", //relative to project root
  ignoredAttributes: ["created_at", "updated_at"] //these attributes will be deeply removed from all objects in the json
}));


//component.spec.js
it("renders correctly", () => {
  const state = Immutable.fromJS({user: null});
  const login = toJSON(shallow(<Login user={state.user}/>));
  expect(login).to.matchSnapshotJSON();
});