feat: add template based data generator

This commit is contained in:
Joachim Van Herwegen
2020-11-27 13:44:41 +01:00
parent 9653deec7f
commit f387b36dc2
14 changed files with 285 additions and 6 deletions

View File

@@ -0,0 +1,11 @@
import { HandlebarsTemplateEngine } from '../../../../src/pods/generate/HandlebarsTemplateEngine';
describe('A HandlebarsTemplateEngine', (): void => {
const engine = new HandlebarsTemplateEngine();
it('fills in Handlebars templates.', async(): Promise<void> => {
const template = '<{{webId}}> a <http://xmlns.com/foaf/0.1/Person>.';
const options = { webId: 'http://alice/#profile' };
expect(engine.apply(template, options)).toBe('<http://alice/#profile> a <http://xmlns.com/foaf/0.1/Person>.');
});
});