dokkie
Version:
Create good looking documentation from your Readme
31 lines • 1.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const handlebars_1 = require("../utils/handlebars");
test("Renders Handlebars", () => {
const template = handlebars_1.Handlebars.compile(`<p>{{{ title }}}</p>`);
const contents = template({
title: `<h1>Title</h1>`,
});
const output = "<p><h1>Title</h1></p>";
// Assert
expect(expect(contents).toEqual(output));
});
test("Renders Handlebars - test eq function", () => {
const template = handlebars_1.Handlebars.compile(`{{#if (eq title 'Title')}}<p><h1>{{title}}</h1></p>{{/if}}`);
const contents = template({
title: `Title`,
});
const output = "<p><h1>Title</h1></p>";
// Assert
expect(expect(contents).toEqual(output));
});
test("Renders Handlebars - test date function", () => {
const template = handlebars_1.Handlebars.compile(`{{ dateFormat date format="yy MM Do" }}`);
const contents = template({
date: `2020-02-12`,
});
const output = "20 02 43rd";
// Assert
expect(expect(contents).toEqual(output));
});
//# sourceMappingURL=handlebars.spec.js.map