Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Grunt

You're reading from   Learning Grunt Monitor and automate complex JavaScript tasks and processes by obtaining a practical understanding of Grunt

Arrow left icon
Product type Paperback
Published in Mar 2016
Publisher Packt
ISBN-13 9781785888809
Length 184 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Douglas Reynolds Douglas Reynolds
Author Profile Icon Douglas Reynolds
Douglas Reynolds
Arrow right icon
View More author details
Toc

Functional testing


We have reached a point in our sample_project Gruntfile setup where we are ready to begin testing the functionality of each registered task to ensure that we are meeting the project requirements. Recall that we have implemented the following plugins:

  • contrib-jshint

  • contrib-uglify

  • contrib-less

  • contrib-imagemin

  • notify

  • open

  • contrib-watch

Starting at the top, we will test each requirement individually, then we will begin adding in the entire stack to create our automated build process. We do have a banner option that is not a task; it is simply a property with a value that we can use elsewhere. In the case of our configuration, the banner is used by contrib-uglify. We will start with contrib-jshint testing.

The process for testing individual tasks is simple: we will only register the task we wish to test and then inspect the result of the task to ensure that what we expected to happen has indeed happened. Our custom task with a callback function that takes arguments is a handy way...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime