O'Reilly logo

Learning Yeoman by Jonathan Spratley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Backbone generator solutions

This section covers some solutions that one might need when using the Backbone generator.

Code coverage with Karma

Problem: You want to run your project's unit tests with Karma and generate code coverage for your project.

Solution: Since you want to use Karma and leverage the karma-coverage plugin, you will need to create and configure a test/test-main.js file that will parse all the indexed files and create an array of spec files that are then added to the Require.js configuration as dependencies. After all the files have been indexed, you will need to start Karma so the specs can be run. To do so, perform the following steps:

Installing Karma and plugins

Since the Yeoman Backbone generator creates a Karma configuration ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required