You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/packages/svelte/tests/runtime-runes/samples/hydratable-unused-keys/_config.js

30 lines
853 B

import { tick } from 'svelte';
import { test } from '../../test';
export default test({
skip_no_async: true,
mode: ['async-server', 'hydrate'],
server_props: { environment: 'server' },
ssrHtml: '<div>Loading...</div>',
test_ssr({ assert, warnings }) {
assert.strictEqual(warnings.length, 1);
// for some strange reason we trim the error code off the beginning of warnings so I can't actually assert it
assert.include(
warnings[0],
'Part of the data added to `Warp` instances was not used during the render'
);
},
async test({ assert, target }) {
// make sure the hydratable promise on the client has a chance to run and reject (it shouldn't, because the server data should be used)
await tick();
assert.htmlEqual(
target.innerHTML,
'<div>did you ever hear the tragedy of darth plagueis the wise?</div>'
);
}
});