mirror of https://github.com/sveltejs/svelte
Merge branch 'test/nil-hydrate' of https://github.com/eps1lon/svelte into eps1lon-test/nil-hydrate
commit
3a99a74bdc
@ -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