mirror of https://github.com/sveltejs/svelte
parent
a9b26c3ffe
commit
62a6a15b8a
@ -1,7 +1,18 @@
|
|||||||
import { test } from '../../test';
|
import { test } from '../../test';
|
||||||
|
|
||||||
export default test({
|
export default test({
|
||||||
mode: ['client', 'hydrate'],
|
mode: ['hydrate', 'client'],
|
||||||
recover: true,
|
recover: true,
|
||||||
runtime_error: 'invalid_html_structure'
|
needs_import_logs: true,
|
||||||
|
test({ warnings, assert, variant }) {
|
||||||
|
const expected_warnings = [
|
||||||
|
'This html structure `<p></p><tr></tr>` would be corrected like this `<p></p>` by the browser making this component impossible to hydrate properly'
|
||||||
|
];
|
||||||
|
if (variant === 'hydrate') {
|
||||||
|
expected_warnings.push(
|
||||||
|
'Hydration failed because the initial UI does not match what was rendered on the server'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
assert.deepEqual(warnings, expected_warnings);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in new issue