mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
[ci] format
This commit is contained in:
parent
994337c99f
commit
e8683d90f3
2 changed files with 8 additions and 8 deletions
|
@ -9,7 +9,7 @@ import type { Logger } from '../logger/core.js';
|
|||
function getFunctionExpression(slot: any) {
|
||||
if (!slot) return;
|
||||
const expressions = slot?.expressions?.filter((e: unknown) => isRenderInstruction(e) === false);
|
||||
if (expressions?.length !== 1) return
|
||||
if (expressions?.length !== 1) return;
|
||||
return expressions[0] as (...args: any[]) => any;
|
||||
}
|
||||
|
||||
|
|
|
@ -171,14 +171,14 @@ describe('Slots', () => {
|
|||
}
|
||||
});
|
||||
|
||||
it("Arguments can be passed to named slots with Astro.slots.render()", async () => {
|
||||
it('Arguments can be passed to named slots with Astro.slots.render()', async () => {
|
||||
const html = await fixture.readFile('/slotted-named-functions/index.html');
|
||||
const $ = cheerio.load(html);
|
||||
const befor = $("div#before");
|
||||
const [ beforeDiv ] = befor.children("div")
|
||||
assert.deepEqual(beforeDiv.firstChild.data, "Test Content BEFORE")
|
||||
const after = $("div#after");
|
||||
const [ afterDiv ] = after.children("div");
|
||||
assert.deepEqual(afterDiv.firstChild.data, "Test Content AFTER")
|
||||
const befor = $('div#before');
|
||||
const [beforeDiv] = befor.children('div');
|
||||
assert.deepEqual(beforeDiv.firstChild.data, 'Test Content BEFORE');
|
||||
const after = $('div#after');
|
||||
const [afterDiv] = after.children('div');
|
||||
assert.deepEqual(afterDiv.firstChild.data, 'Test Content AFTER');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue