smartntml/test/test.ts
2024-05-28 00:28:33 +02:00

27 lines
748 B
TypeScript

import log from 'why-is-node-running';
import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
import * as smartntml from '../ts/index.js';
let testSmartntmlInstance: smartntml.Smartntml;
tap.test('first test', async () => {
testSmartntmlInstance = new smartntml.Smartntml();
});
tap.test('should render a string', async () => {
const arrayArg = [1, 2, 3, 4, 5, 6];
const stringResult = await testSmartntmlInstance.renderTemplateResult(smartntml.deesElement.html`
<div class="hello">${arrayArg.map(
(element) => smartntml.deesElement.html`<div>${element}</div>`
)}</div>
`);
console.log(stringResult);
});
tap.test('should log', async () => {
log();
setTimeout(() => process.exit(0), 0);
});
tap.start();