Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save taverasmisael/b46cf2bbf0f55fb583cb506eab4f3404 to your computer and use it in GitHub Desktop.
Save taverasmisael/b46cf2bbf0f55fb583cb506eab4f3404 to your computer and use it in GitHub Desktop.
import {render, simulate} from 'test-library-for-react'
import Component from './Component'
describe ('my obscure test', () => {
// This test does not add any value even though it passes
// and probably meet the code coverage requirement.
it ('should work', () => {
const component = render(<Component />)
simulate.click(component.find('button'))
// Waaat! No idea what the click was supposed to do
// Or how he reacted. We must always choose
// readability above comfort.
expect(component).toMatchSnapshot ()
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment