fix(build): modernize project configuration, dependencies, and node-based test setup
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { tap } from '@git.zone/tstest/tapbundle';
|
||||
import { GlobalRegistrator } from '@happy-dom/global-registrator';
|
||||
import * as smartntml from '../ts/index.js';
|
||||
|
||||
let testSmartntmlInstance: smartntml.Smartntml;
|
||||
|
||||
tap.registerCleanup(async () => {
|
||||
if (GlobalRegistrator.isRegistered) {
|
||||
await GlobalRegistrator.unregister();
|
||||
}
|
||||
await tap.stopForcefully(0);
|
||||
});
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
export default tap.start();
|
||||
Reference in New Issue
Block a user