Prepend, not append, test results

This commit is contained in:
Maurício Szabo 2023-05-31 12:06:02 -03:00
parent 538c97b918
commit cd35d9ae5b

View File

@ -26,12 +26,17 @@ class Reporter {
console.log('start'); console.log('start');
}) })
.on(EVENT_SUITE_BEGIN, evt => { .on(EVENT_SUITE_BEGIN, evt => {
const header = document.createElement(`h${divs.length + 1}`) if(evt.root) return;
const level = divs.length + 1;
const header = document.createElement(`h${level}`)
header.innerText = evt.title header.innerText = evt.title
testDiv.appendChild(header)
const div = document.createElement('div') const div = document.createElement('div')
div.appendChild(header)
if(level === 1) {
div.dataset['file'] = evt.file
}
divs.push(div) divs.push(div)
testDiv.appendChild(div) testDiv.prepend(div)
}) })
.on(EVENT_SUITE_END, (a) => { .on(EVENT_SUITE_END, (a) => {
divs.pop() divs.pop()