UNPKG

mustache-jest

Version:

Jest Transformer to compile mustache templates

28 lines (22 loc) 777 B
import { renderToDiv } from './testFile'; describe('renderToDiv', () => { let divElement: HTMLDivElement; 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(); }); }); });