chore: squelch hydration warnings in tests (#18046)

Gets rid of some annoying console spam. I don't totally understand why
`warnings` isn't populated by the time the assertions happen (it seems
to happen just afterwards, except if I sleep for a few milliseconds and
then do the assertion the warnings get swallowed altogether?) but for
right now I don't much care
pull/18063/head
Rich Harris 3 weeks ago committed by GitHub
parent 8ee2169609
commit f8ef6de325
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -6,11 +6,13 @@ export default test({
ssrHtml: '<p>yep</p>',
async test({ assert, target, variant }) {
async test({ assert, target, variant, warnings }) {
if (variant === 'dom') {
await tick();
}
assert.htmlEqual(target.innerHTML, '<p>yep</p>');
assert.deepEqual(warnings, []); // TODO not quite sure why this isn't populated yet
}
});

@ -3,5 +3,7 @@ import { test } from '../../test';
export default test({
skip_no_async: true,
mode: ['hydrate'],
async test() {}
async test({ assert, warnings }) {
assert.deepEqual(warnings, []); // TODO not quite sure why this isn't populated yet
}
});

Loading…
Cancel
Save