Skip to content

Instantly share code, notes, and snippets.

@orYoffe
Last active December 23, 2017 11:41
Show Gist options
  • Save orYoffe/3e4f0a5058eb0a5fa2099e8990555764 to your computer and use it in GitHub Desktop.
Save orYoffe/3e4f0a5058eb0a5fa2099e8990555764 to your computer and use it in GitHub Desktop.
Button.test.js old
import { Platform } from 'react-native';
const mockFunc = jest.fn();
const tree = renderer.create(
<Button text={text} onClick={mockFunc} />
);
if (Platform.OS === 'web') {
it('renders properly on web', () => { // <= the name sets the title for the snapshot
expect(tree.toJSON()).toMatchSnapshot();
});
} else {
it('renders properly on ios', () => { // <=
expect(tree.toJSON()).toMatchSnapshot();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment