@webqit/oohtml
Version:
A suite of new DOM features that brings language support for modern UI development paradigms: a component-based architecture, data binding, and reactivity.
32 lines (24 loc) • 868 B
JavaScript
/**
* @imports
*/
import { expect } from 'chai';
import { createDocument, delay } from './index.js';
describe(`Test: Scoped JS`, function() {
describe(`Scripts`, function() {
it(`Should do basic observe`, async function() {
const head = ``;
const body = `
<h1>Hello World!</h1>
<script scoped ssr>
"use live";
testRecords.push( this );
console.log('-------scoped JS here.');
</script>`;
const window = createDocument( head, body );
window.testRecords = [];
await delay( 500 ); // Takes time to dynamically load Reflex compiler
expect( window.testRecords ).to.have.length( 1 );
expect( window.testRecords[ 0 ] ).to.eql( window.document.body );
});
});
});