UNPKG

jest-hbs-extension

Version:
17 lines (12 loc) 405 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _handlebars = require('handlebars'); var _fs = require('fs'); exports.default = (html, { templatePath, data }) => { const template = (0, _fs.readFileSync)(templatePath).toString(); const compileHtml = (0, _handlebars.compile)(template); const compiledHtml = compileHtml(data); return html === compiledHtml; };