BREAKING CHANGE(improved the loading of the environment. Can now be used in sync environments.): update

This commit is contained in:
2023-03-30 11:08:29 +02:00
parent 2f1ce0058c
commit a689252f4b
7 changed files with 47 additions and 160 deletions

View File

@ -5,14 +5,14 @@ import * as smartntml from '../ts/index.js';
let testSmartntmlInstance: smartntml.Smartntml;
tap.test('first test', async () => {
testSmartntmlInstance = await smartntml.Smartntml.create();
testSmartntmlInstance = new smartntml.Smartntml();
});
tap.test('should render a string', async () => {
const arrayArg = [1, 2, 3, 4, 5, 6];
const stringResult = await testSmartntmlInstance.renderTemplateResult(testSmartntmlInstance.html`
const stringResult = await testSmartntmlInstance.renderTemplateResult(smartntml.deesElement.html`
<div class="hello">${arrayArg.map(
(element) => testSmartntmlInstance.html`<div>${element}</div>`
(element) => smartntml.deesElement.html`<div>${element}</div>`
)}</div>
`);
console.log(stringResult);