...

/

JavaScript Unit-Testing using Karma Module

JavaScript Unit-Testing using Karma Module

Learn how to set up a JavaScript unit-test using Karma, a karma.conf.js file, managing Karma, configuring Karma, and manifest files.

Karma

Karma is easiest to run if we install the karma-cli module, but since that’s external to this project, it’s best to install it as a global module so that the karma command is just available.

$ yarn global add karma-cli

Configuring Karma

Now that all the modules are loaded, some configuration is necessary. Let’s start with Karma. All kinds of details that RSpec and Rails handle for us under the banner of “convention over configuration” are actually configuration options in Karma, and ...