Skip to content

A helper to compile your handlebars templates in your jest tests

Notifications You must be signed in to change notification settings

jon-stevens/jest-hbs-compile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Import the helpers and call compileTemplate, passing in the hbs file, and the model. It will automatically register any partials it finds.

import mainTemplate from 'views/pages/home.hbs';
import model from 'models/home';
import Helpers from './test-helpers';

describe('test block', () => {
	const helpers = new Helpers();

	beforeEach(async () => {
		const html = await helpers.compileTemplate({
			mainTemplate,
			model
		});
		document.body.innerHTML = html;
	});
};

About

A helper to compile your handlebars templates in your jest tests

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published