-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathindex.test.es
More file actions
38 lines (27 loc) · 1.21 KB
/
index.test.es
File metadata and controls
38 lines (27 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const { view, assert, test, describe, context } = require('./test')
// The resulting document's scheme will be a file://
, window = view ( 'index.test.html' )
describe ('scripts', _=> {
const
source = window.document.scripts[0].src
test ('<script> source', _=> {
// await window.customElements.whenDefined('foo-bar')
console.log( window.document.documentElement.outerHTML )
const i = window.document.createNodeIterator(
window.document.body,
window.NodeFilter.SHOW_ELEMENT,
{ acceptNode(node) { return node.tagName != 'FOO-BAR' ? window.NodeFilter.FILTER_ACCEPT : window.NodeFilter.FILTER_SKIP } }
);
const pars = [];
let currentNode;
while ((currentNode = i.nextNode())) { pars.push(currentNode) }
console.log( pars )
console.log ( 'body[role]', window.document.body.attributes['role'].textContent )
console.log ( '#content', window.document.getElementById('content').attributes['id'].textContent )
let d = window.document.implementation
.createHTMLDocument('SHAZAAAAMMM!!!')
console.log( d.documentElement.outerHTML )
// assert (source === 'https://unpkg.com/snuggsi')
assert ( /snuggsi/.test ( source ) )
}) // test
}) // describe