pull/13034/head
Rich Harris 2 years ago
parent e0f6df3d04
commit ef564ae756

@ -3,11 +3,18 @@ import { test } from '../../test';
export default test({
html: '<p><p>invalid</p></p>',
mode: ['hydrate'],
recover: true,
test({ assert, target, logs }) {
target.click();
flushSync();
assert.deepEqual(logs, ['body', 'document', 'window']);
}
},
warnings: [
'Hydration failed because the initial UI does not match what was rendered on the server'
]
});

@ -16,6 +16,8 @@ export default test({
recover: true,
mode: ['hydrate'],
before_test() {
console.error = (x) => {
log.push(x);
@ -27,8 +29,7 @@ export default test({
log.length = 0;
},
async test({ assert, variant }) {
if (variant === 'hydrate') {
async test({ assert }) {
assert.equal(
log[0].split('\n')[0],
'node_invalid_placement_ssr: `<p>` (main.svelte:6:0) cannot contain `<h1>` (h1.svelte:1:0)'
@ -37,6 +38,9 @@ export default test({
log[1].split('\n')[0],
'node_invalid_placement_ssr: `<form>` (main.svelte:9:0) cannot contain `<form>` (form.svelte:1:0)'
);
}
}
},
warnings: [
'Hydration failed because the initial UI does not match what was rendered on the server'
]
});

Loading…
Cancel
Save