Skip to content

Instantly share code, notes, and snippets.

@ricca509
Last active February 22, 2017 11:01
Show Gist options
  • Save ricca509/4411eb0ce0fd4696369b50867d3d0bf8 to your computer and use it in GitHub Desktop.
Save ricca509/4411eb0ce0fd4696369b50867d3d0bf8 to your computer and use it in GitHub Desktop.
snapshot-serialisable.js
describe('Snapshot tests', () => {
it('work with objects', () => {
expect({
a: 234,
b: 'test',
c: null,
d: undefined,
}).toMatchSnapshot();
});
it('work with strings', () => {
expect('This is a test').toMatchSnapshot();
});
it('work with arrays', () => {
expect(['a', 5, () => 3]).toMatchSnapshot();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment