chore: squelch hydration warning in test suite (#16336)

pull/16368/head
Rich Harris 2 months ago committed by GitHub
parent 616d29f5cd
commit be0818552d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,7 +1,13 @@
import { test } from '../../test'; import { test } from '../../test';
export default test({ export default test({
test({ assert, target, logs }) { test({ assert, target, logs, warnings, variant }) {
if (variant === 'hydrate') {
assert.deepEqual(warnings, [
'Hydration failed because the initial UI does not match what was rendered on the server'
]);
}
assert.deepEqual(logs, ['error caught']); assert.deepEqual(logs, ['error caught']);
assert.htmlEqual(target.innerHTML, `<div>Error!</div><button>Retry</button>`); assert.htmlEqual(target.innerHTML, `<div>Error!</div><button>Retry</button>`);
} }

Loading…
Cancel
Save