const should = require('should'); const errors = require('@tryghost/errors'); const {hbs, templates} = require('../../../../../core/frontend/services/rendering'); describe('Helpers Template', function () { it('can execute a template', function () { hbs.registerPartial('test', '

Hello {{name}}

'); const safeString = templates.execute('test', {name: 'world'}); should.exist(safeString); safeString.should.have.property('string').and.equal('

Hello world

'); }); it('will throw an IncorrectUsageError if the partial does not exist', function () { should.throws(() => { templates.execute('non-existent'); }, errors.IncorrectUsageError); }); });