mustache-jest
Version:
Jest Transformer to compile mustache templates
28 lines (22 loc) • 762 B
JavaScript
const renderToDiv = require('./testFile');
describe('renderToDiv', () => {
let divElement;
describe('when shouldShow is true', () => {
beforeEach(() => {
divElement = document.createElement('div');
renderToDiv(divElement, { name: 'josie', shouldShow: true });
});
it('contains the content from the compiled template', () => {
expect(divElement.innerHTML).toMatchSnapshot();
});
});
describe('when shouldShow is false', () => {
beforeEach(() => {
divElement = document.createElement('div');
renderToDiv(divElement, { name: 'josie', shouldShow: false });
});
it('contains the content from the compiled template', () => {
expect(divElement.innerHTML).toMatchSnapshot();
});
});
});