mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-20 14:25:07 +00:00
work around Svelte hydration failures
This commit is contained in:
@@ -13,6 +13,8 @@
|
|||||||
<p><strong>Try editing this file (routes/index.html) to test hot module reloading.</strong></p>
|
<p><strong>Try editing this file (routes/index.html) to test hot module reloading.</strong></p>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
||||||
|
<div class='hydrate-test'></div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
h1, figure, p {
|
h1, figure, p {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
@@ -317,13 +317,13 @@ function run(env) {
|
|||||||
|
|
||||||
it('hydrates initial route', () => {
|
it('hydrates initial route', () => {
|
||||||
return nightmare.goto(base)
|
return nightmare.goto(base)
|
||||||
.wait('h1')
|
.wait('.hydrate-test')
|
||||||
.evaluate(() => {
|
.evaluate(() => {
|
||||||
window.h1 = document.querySelector('h1');
|
window.el = document.querySelector('.hydrate-test');
|
||||||
})
|
})
|
||||||
.init().wait(100)
|
.init().wait(100)
|
||||||
.evaluate(() => {
|
.evaluate(() => {
|
||||||
return document.querySelector('h1') === window.h1;
|
return document.querySelector('.hydrate-test') === window.el;
|
||||||
})
|
})
|
||||||
.then(matches => {
|
.then(matches => {
|
||||||
assert.ok(matches);
|
assert.ok(matches);
|
||||||
|
|||||||
Reference in New Issue
Block a user