diff options
author | 2024-04-11 02:38:29 +0000 | |
---|---|---|
committer | 2024-04-11 02:38:29 +0000 | |
commit | e8683d90f3c1af4f922219ae135513a438b53afc (patch) | |
tree | 332c9267695742dc699db70d2b23f7eed528854c | |
parent | 994337c99f84304df1147a14504659439a9a7326 (diff) | |
download | astro-e8683d90f3c1af4f922219ae135513a438b53afc.tar.gz astro-e8683d90f3c1af4f922219ae135513a438b53afc.tar.zst astro-e8683d90f3c1af4f922219ae135513a438b53afc.zip |
[ci] format
-rw-r--r-- | packages/astro/src/core/render/slots.ts | 2 | ||||
-rw-r--r-- | packages/astro/test/astro-slots.test.js | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/packages/astro/src/core/render/slots.ts b/packages/astro/src/core/render/slots.ts index f6d469b2a..b590237ba 100644 --- a/packages/astro/src/core/render/slots.ts +++ b/packages/astro/src/core/render/slots.ts @@ -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; } diff --git a/packages/astro/test/astro-slots.test.js b/packages/astro/test/astro-slots.test.js index 5078ead05..78b8a5cae 100644 --- a/packages/astro/test/astro-slots.test.js +++ b/packages/astro/test/astro-slots.test.js @@ -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'); }); }); |