Check for undefined html output

added undefined html check in the grunt task and mocha tests. Is it okay?