Skip to content

Instantly share code, notes, and snippets.

@gdborton
Created June 2, 2017 18:42
Show Gist options
  • Save gdborton/f4784f48e75d403f1a8f0d938f7f524d to your computer and use it in GitHub Desktop.
Save gdborton/f4784f48e75d403f1a8f0d938f7f524d to your computer and use it in GitHub Desktop.
Converted Test File
import { expect } from 'chai';
// how a test might have been written Mocha.
describe('addition', () => {
context('a sane universe', () => {
test('one plus two equals three', () => {
expect(1 + 2).to.equal(3);
});
});
});
// how the same test works with our Jest implementation.
describe('addition', () => {
// context only works in Jest here because of the previous snippet
context('a sane universe', () => {
// This is the only line that has changed `test` => `it`
it('one plus two equals three', () => {
expect(1 + 2).to.equal(3);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment