Skip to content

Instantly share code, notes, and snippets.

@leventebalogh
Created May 26, 2017 13:16
Show Gist options
  • Save leventebalogh/648201e0825f9b6b8dcb38df04060dad to your computer and use it in GitHub Desktop.
Save leventebalogh/648201e0825f9b6b8dcb38df04060dad to your computer and use it in GitHub Desktop.
Button.test.js - A sample React Component test file
import React from 'react';
import Button from './Button.jsx';
import { expect } from 'chai';
import { shallow } from 'enzyme';
describe('foo', () => {
it('contains spec with an expectation', () => {
expect(shallow(<Button />).contains(<span>FooBar</span>)).to.equal(true);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment