mirror of https://github.com/sveltejs/svelte
parent
2ef004e324
commit
12c667f898
@ -0,0 +1,2 @@
|
|||||||
|
<p></p>
|
||||||
|
<p>undefined</p>
|
@ -0,0 +1,2 @@
|
|||||||
|
<p>null</p>
|
||||||
|
<p>undefined</p>
|
@ -0,0 +1,21 @@
|
|||||||
|
export default {
|
||||||
|
props: {},
|
||||||
|
|
||||||
|
snapshot(target) {
|
||||||
|
const nullText = target.querySelectorAll('p')[0].textContent;
|
||||||
|
const undefinedText = target.querySelectorAll('p')[1].textContent;
|
||||||
|
|
||||||
|
return {
|
||||||
|
nullText,
|
||||||
|
undefinedText,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
test(assert, target, snapshot) {
|
||||||
|
const nullText = target.querySelectorAll('p')[0].textContent;
|
||||||
|
const undefinedText = target.querySelectorAll('p')[1].textContent;
|
||||||
|
|
||||||
|
assert.equal(nullText, snapshot.nullText);
|
||||||
|
assert.equal(undefinedText, snapshot.undefinedText);
|
||||||
|
},
|
||||||
|
};
|
@ -0,0 +1,7 @@
|
|||||||
|
<script>
|
||||||
|
let maybeNull = null;
|
||||||
|
let maybeUndefined = undefined;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<p>{maybeNull}</p>
|
||||||
|
<p>{maybeUndefined}</p>
|
Loading…
Reference in new issue