In April 2016, I gave a talk at Red Badger’s React London User Group meetup in London, on the topic of “Unit Testing React Applications with Mocha, Chai and Enzyme”. The talk introduces the fundamentals of testing a React application with AirBnB’s excellent Enzyme library, and explains my approach to both unit and integration testing apps using the combination of Mocha, Chai and Enzyme. Both the code samples, and the slides are available on GitHub.
Introduction This post is a brain dump of the steps required to set up a Typescript and React project with some explanatory notes – I intend to write about working with Typescript and React in a real world project in more detail soon. Some knowledge of React and of the basics of Typescript is assumed. These instructions will guide you through setting up a new project with Typescript, React, Webpack and Babel – neither Webpack nor Babel are required to work with Typescript, as Typescript can transpile ES6 to ES5 and do some degree of bundling itself; but using them enables Hot Module Reloading, and also allows you to run other Babel and Webpack plugins on the compiled output if desired.