Unit testing a React component using Jasmine and Webpack

InstructorSimon Bailey

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.

Free Community Resource

A Community Resource means that it’s free to access for all. The instructor of this lesson requested it to be open to the public.

Kent C. Dodds
Kent C. Dodds
~ 6 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)
~ 6 years ago

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

dave
dave
~ 5 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