All files / lib utils.js

100% Statements 7/7
0% Branches 0/1
100% Functions 2/2
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21        7x 7x     7x 28x 28x               7x 13x  
/**
 * Any thing useful that can be reused?
 */
 
const handlebars = require('handlebars');
const cheerio = require('cheerio');
 
 
exports.parseMessage = function(template = 'Empty message', data) {
  const messageTemplate = handlebars.compile(template);
  return messageTemplate(data);
}
 
/**
 * Convert Html text into jQuery representation of the dom
 * <body></body> => $('body') ;) Easier right!?
 * @param {string} htmlText 
 */
exports.htmlTo$ = function(htmlText) {
  return cheerio.load(htmlText);
}