From 5121740de72535edd5cf227d1ab18da1024546c8 Mon Sep 17 00:00:00 2001 From: delucis Date: Wed, 27 Sep 2023 19:19:41 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/integrations/index.ts | 2 +- .../astro/test/units/integrations/api.test.js | 29 ++++++++++--------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/packages/astro/src/integrations/index.ts b/packages/astro/src/integrations/index.ts index 8d557cae7..5485794c5 100644 --- a/packages/astro/src/integrations/index.ts +++ b/packages/astro/src/integrations/index.ts @@ -78,7 +78,7 @@ export async function runHookConfigSetup({ // eslint-disable-next-line @typescript-eslint/prefer-for-of -- We need a for loop to be able to read integrations pushed while the loop is running. for (let i = 0; i < updatedConfig.integrations.length; i++) { const integration = updatedConfig.integrations[i]; - + /** * By making integration hooks optional, Astro can now ignore null or undefined Integrations * instead of giving an internal error most people can't read diff --git a/packages/astro/test/units/integrations/api.test.js b/packages/astro/test/units/integrations/api.test.js index 0940a78f7..a4a76975a 100644 --- a/packages/astro/test/units/integrations/api.test.js +++ b/packages/astro/test/units/integrations/api.test.js @@ -40,9 +40,9 @@ describe('Integration API', () => { { name: 'test', hooks: { - "astro:config:setup": ({ updateConfig }) => { + 'astro:config:setup': ({ updateConfig }) => { updateConfig({ site }); - } + }, }, }, ], @@ -51,7 +51,7 @@ describe('Integration API', () => { }); expect(updatedSettings.config.site).to.equal(site); }); - + it('runHookConfigSetup runs integrations added by another integration', async () => { const site = 'https://test.com/'; const updatedSettings = await runHookConfigSetup({ @@ -62,19 +62,21 @@ describe('Integration API', () => { { name: 'test', hooks: { - "astro:config:setup": ({ updateConfig }) => { + 'astro:config:setup': ({ updateConfig }) => { updateConfig({ - integrations: [{ - name: 'dynamically-added', - hooks: { - // eslint-disable-next-line @typescript-eslint/no-shadow - "astro:config:setup": ({ updateConfig }) => { - updateConfig({ site }); - } + integrations: [ + { + name: 'dynamically-added', + hooks: { + // eslint-disable-next-line @typescript-eslint/no-shadow + 'astro:config:setup': ({ updateConfig }) => { + updateConfig({ site }); + }, + }, }, - }], + ], }); - } + }, }, }, ], @@ -84,7 +86,6 @@ describe('Integration API', () => { expect(updatedSettings.config.site).to.equal(site); expect(updatedSettings.config.integrations.length).to.equal(2); }); - }); describe('Astro feature map', function () {