mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 03:05:12 +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>
|
||||
</Layout>
|
||||
|
||||
<div class='hydrate-test'></div>
|
||||
|
||||
<style>
|
||||
h1, figure, p {
|
||||
text-align: center;
|
||||
|
||||
@@ -317,13 +317,13 @@ function run(env) {
|
||||
|
||||
it('hydrates initial route', () => {
|
||||
return nightmare.goto(base)
|
||||
.wait('h1')
|
||||
.wait('.hydrate-test')
|
||||
.evaluate(() => {
|
||||
window.h1 = document.querySelector('h1');
|
||||
window.el = document.querySelector('.hydrate-test');
|
||||
})
|
||||
.init().wait(100)
|
||||
.evaluate(() => {
|
||||
return document.querySelector('h1') === window.h1;
|
||||
return document.querySelector('.hydrate-test') === window.el;
|
||||
})
|
||||
.then(matches => {
|
||||
assert.ok(matches);
|
||||
|
||||
Reference in New Issue
Block a user