Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Chore: Replace mocha (istanbul, chai, leche) with Jest #300

Merged
merged 1 commit into from
May 28, 2017
Merged

Conversation

JamesHenry
Copy link
Member

This PR exactly matches our current usage of Mocha (+ istanbul, chai and leche) but using Jest.

There is no change in how assertions are being made, nor how coverage is reported (Jest can provide it out of the box).

I have continued to use the original Makefile for the primary npm test command so as to minimise the changes in this initial PR, but added an additional npm run jest command (for development purposes), because Jest gives really nice output for failures/diffs and you lose the colour from that when executing it via another tool (Makefile nodeCLI).

Jest's watch mode is also excellent for development, so you now easily run that using npm run jest -- --watch.

I plan to explore formatted snapshot testing with Jest in a follow up PR, because it will provide an effortless way for us to deterministically update test cases when we make breaking changes (which will we be doing a lot more of to align with the Babylon work)

@JamesHenry JamesHenry requested a review from soda0289 May 28, 2017 12:14
@soda0289
Copy link
Member

Should we merge this in for the next release?

@JamesHenry
Copy link
Member Author

Shouldn't make any difference either way, it's a development-only concern. I'm happy to wait until the next batch

@JamesHenry JamesHenry merged commit bc9225f into master May 28, 2017
@JamesHenry JamesHenry deleted the jest branch May 28, 2017 22:19
@vjeux
Copy link

vjeux commented May 28, 2017

I plan to explore formatted snapshot testing with Jest in a follow up PR

This has been invaluable for prettier. I honestly don't think I would have finished it without snapshot testing. I highly recommend :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants