[ci] format

This commit is contained in:
matthewp 2022-10-13 21:42:13 +00:00 committed by fredkbot
parent 90b715d5c8
commit f49d80d637

View file

@ -54,7 +54,7 @@ describe('core/render', () => {
const Wrapper = createComponent((result, _props, slots = {}) => { const Wrapper = createComponent((result, _props, slots = {}) => {
return render`<div>${renderSlot(result, slots['my-slot'])}</div>`; return render`<div>${renderSlot(result, slots['my-slot'])}</div>`;
}); });
const Page = createAstroJSXComponent(() => { const Page = createAstroJSXComponent(() => {
return jsx('main', { return jsx('main', {
children: [ children: [
@ -64,29 +64,31 @@ describe('core/render', () => {
jsx('p', { jsx('p', {
slot: 'my-slot', slot: 'my-slot',
className: 'n', className: 'n',
children: 'works' children: 'works',
}) }),
] ],
}), }),
jsx(Wrapper, { jsx(Wrapper, {
// Children as a VNode // Children as a VNode
children: jsx('p', { children: jsx('p', {
slot: 'my-slot', slot: 'my-slot',
className: 'p', className: 'p',
children: 'works' children: 'works',
}) }),
}) }),
] ],
}) });
}); });
const ctx = createRenderContext({ request: new Request('http://example.com/' )}); const ctx = createRenderContext({ request: new Request('http://example.com/') });
const response = await renderPage(createAstroModule(Page), ctx, env); const response = await renderPage(createAstroModule(Page), ctx, env);
expect(response.status).to.equal(200); expect(response.status).to.equal(200);
const html = await response.text(); const html = await response.text();
expect(html).to.include('<main><div><p class="n">works</p></div><div><p class="p">works</p></div></main>'); expect(html).to.include(
'<main><div><p class="n">works</p></div><div><p class="p">works</p></div></main>'
);
}); });
}); });
}); });