push
github
1754 of 1760 branches covered (99.66%)
2 of 2 new or added lines in 1 file covered. (100.0%)
1 existing line in 1 file now uncovered.2223 of 2224 relevant lines covered (99.96%)
143.67 hits per line
1 |
export default function render(fn, useShadow) { |
|
2 |
return {
|
41✔ |
3 |
get: useShadow
|
|
4 |
? (host) => { |
|
5 |
const updateDOM = fn(host); |
58✔ |
6 |
const target = |
|
7 |
host.shadowRoot || |
|
8 |
host.attachShadow({ |
|
9 |
mode: "open", |
|
10 |
delegatesFocus: fn.delegatesFocus || false, |
|
11 |
}); |
|
12 |
return () => {
|
58✔ |
13 |
updateDOM(host, target); |
69✔ |
14 |
return target;
|
69✔ |
15 |
}; |
|
16 |
} |
|
17 |
: (host) => { |
|
18 |
const updateDOM = fn(host); |
149✔ |
19 |
return () => {
|
149✔ |
20 |
updateDOM(host, host); |
149✔ |
21 |
return host;
|
149✔ |
22 |
}; |
|
23 |
}, |
|
24 |
observe(host, flush) { |
|
25 |
flush(); |
207✔ |
26 |
}, |
|
27 |
}; |
|
28 |
} |