small tweak to aid greppability

pull/16781/head
Rich Harris 4 weeks ago
parent a84c78b9a1
commit 41f0ff4115

@ -67,10 +67,11 @@ const { test, run } = suite_with_variants<SSRTest, 'sync' | 'async', CompileOpti
async (config, test_dir, variant, compile_options) => {
const Component = (await import(`${test_dir}/_output/server/main.svelte.js`)).default;
const expected_html = try_read_file(`${test_dir}/_expected.html`);
const is_async = variant === 'async';
let rendered;
try {
rendered =
variant === 'async'
rendered = is_async
? await renderAsync(Component, {
props: config.props || {},
idPrefix: config.id_prefix
@ -90,11 +91,16 @@ const { test, run } = suite_with_variants<SSRTest, 'sync' | 'async', CompileOpti
const { body, head } = rendered;
const prefix = variant === 'async' ? 'async_' : '';
fs.writeFileSync(`${test_dir}/_output/${prefix}rendered.html`, body);
fs.writeFileSync(
`${test_dir}/_output/${is_async ? 'async_rendered.html' : 'rendered.html'}`,
body
);
if (head) {
fs.writeFileSync(`${test_dir}/_output/${prefix}rendered_head.html`, head);
fs.writeFileSync(
`${test_dir}/_output/${is_async ? 'async_rendered_head.html' : 'rendered_head.html'}`,
head
);
}
try {

Loading…
Cancel
Save