push
github
1738 of 1745 branches covered (99.6%)
2 of 2 new or added lines in 1 file covered. (100.0%)
2198 of 2198 relevant lines covered (100.0%)
275.79 hits per line
1 |
export default function render(fn, useShadow) { |
|
2 |
return {
|
74✔ |
3 |
get: useShadow
|
|
4 |
? (host) => { |
|
5 |
const updateDOM = fn(host); |
110✔ |
6 |
const target = |
|
7 |
host.shadowRoot || |
|
8 |
host.attachShadow({ |
|
9 |
mode: "open", |
|
10 |
delegatesFocus: fn.delegatesFocus || false, |
|
11 |
}); |
|
12 |
return () => {
|
110✔ |
13 |
updateDOM(host, target); |
132✔ |
14 |
return target;
|
132✔ |
15 |
}; |
|
16 |
} |
|
17 |
: (host) => { |
|
18 |
const updateDOM = fn(host); |
288✔ |
19 |
return () => {
|
288✔ |
20 |
updateDOM(host, host); |
288✔ |
21 |
return host;
|
288✔ |
22 |
}; |
|
23 |
}, |
|
24 |
observe(host, flush) { |
|
25 |
flush(); |
398✔ |
26 |
}, |
|
27 |
}; |
|
28 |
} |