Grunt Cookbook by Botha Jurie-Jan

Grunt Cookbook by Botha Jurie-Jan

Author:Botha, Jurie-Jan
Language: eng
Format: epub, azw3
Publisher: Packt Publishing
Published: 2015-06-29T04:00:00+00:00


How to do it...

The following steps take us through creating a sample code base, creating a few tests to run against the code base, and configuring Grunt to run them for us.

We'll start by installing the package that contains the mocha-test plugin by following the instructions provided in the Installing a plugin recipe in Chapter 1, Getting Started with Grunt.

Then, we can create a JavaScript source file in our project directory that contains and exports a function that we'd like to have tested. Let's call it main.js and add the following content to it:module.exports.square = function (x) { return x * x; }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.