What is a task runner?
In the context of web scripting, task runners are the libraries that help us to perform functionalities with ease and minimum effort. Task runners can help in doing the following:
- Minifying your client application JavaScript file to increase overall performance
- Configuring your app modules selection at build time
- Creating a build that only comprises a single
index.html
file, CSS, assets, and minified and uglified JavaScript on a single command - Testing BDD (behavior-driven data) assertions
In this chapter, we are going to test our APIs individually using the default assertion library of Node, and we are going to automate them using the gulp task runner library. In Chapter 9, Storing JSON Documents in MongoDB, we created two APIs in our hapi application; now we are going to test them. Before creating the tasks, let's learn about gulp.js
, what it is used for, and what its capabilities are.