Jest is an amazing testing tool developed by the folks at Facebook and maintained by a vast community of developers. Is one of the best ways to write and run Javascript tests. It should be really easy to setup starting from scratch, but what if we want to integrate it into an already initialized project? One which uses Babel 6 and already has a .babelrc
file.
Jest requires Babel to transpile Javascript code that doesn't normally run on NodeJS environments, most commonly ES2015 modules. Problem is Jest dropped support for Babel 6 since 24.0.0
in favour of Babel 7, which introduces a lot of changes to how devs work with Babel. Jest recommends upgrading if your project is still on Babel 6, but not all projects can upgrade quickly. This blog post is for those kinds of projects.
Let's start by i