push
github
1694 of 1700 branches covered (99.65%)
1 of 1 new or added line in 1 file covered. (100.0%)
2131 of 2131 relevant lines covered (100.0%)
135.36 hits per line
1 |
export default function render(fn, useShadow) { |
|
2 |
return {
|
31✔ |
3 |
get: useShadow
|
|
4 |
? (host) => { |
|
5 |
const updateDOM = fn(host); |
52✔ |
6 |
const target = |
|
7 |
host.shadowRoot || |
|
8 |
host.attachShadow({ |
|
9 |
mode: "open", |
|
10 |
delegatesFocus: fn.delegatesFocus || false, |
|
11 |
}); |
|
12 |
return () => {
|
52✔ |
13 |
updateDOM(host, target); |
62✔ |
14 |
return target;
|
62✔ |
15 |
}; |
|
16 |
} |
|
17 |
: (host) => { |
|
18 |
const updateDOM = fn(host); |
127✔ |
19 |
return () => {
|
127✔ |
20 |
updateDOM(host, host); |
127✔ |
21 |
return host;
|
127✔ |
22 |
}; |
|
23 |
}, |
|
24 |
observe(host, flush) { |
|
25 |
flush(); |
179✔ |
26 |
}, |
|
27 |
}; |
|
28 |
} |