Skip to content

Instantly share code, notes, and snippets.

@takethefake
Created February 8, 2019 10:08
Show Gist options
  • Save takethefake/2fd795ab009490696f9b1c78ca5885d3 to your computer and use it in GitHub Desktop.
Save takethefake/2fd795ab009490696f9b1c78ca5885d3 to your computer and use it in GitHub Desktop.
it('will check the matchers and pass', () => {
const user = {
createdAt: new Date(),
id: Math.floor(Math.random() * 20),
name: 'LeBron James',
};
expect(user).toMatchSnapshot({
createdAt: expect.any(Date),
id: expect.any(Number),
});
});
// Snapshot
exports[`will check the matchers and pass 1`] = `
Object {
"createdAt": Any<Date>,
"id": Any<Number>,
"name": "LeBron James",
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment