Unit testing a React component using Jasmine and Webpack

Share this video with your friends

Send Tweet

An introduction on unit testing a ReactJS component using Webpack and Jasmine. Learn how to use Webpack to package and import dependencies plus take advantage of the babel-loader to write a simple Jasmine spec using the latest ES6 syntax.

Kent C. Dodds
Kent C. Dodds
~ 9 years ago

FYI, ES6 runs in implicit 'use strict'; mode, so transpilers (like babel) will add 'use strict'; to the output. :-)

Simon Bailey
Simon Bailey(instructor)
~ 9 years ago

Cheers Kent, I've updated the code on Github to reflect this mate, thanks.

dave
dave
~ 9 years ago

Is it possible to do a webpack , jasmine (or Jest) AND a test runner like karma ? This is useful but how would I incorporate tests into a build process , not just run tests ? Hope I make my self clear