[ci] format

This commit is contained in:
delucis 2023-09-27 19:19:41 +00:00 committed by astrobot-houston
parent 9b0114c7d3
commit 5121740de7
2 changed files with 16 additions and 15 deletions

View file

@ -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. // 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++) { for (let i = 0; i < updatedConfig.integrations.length; i++) {
const integration = updatedConfig.integrations[i]; const integration = updatedConfig.integrations[i];
/** /**
* By making integration hooks optional, Astro can now ignore null or undefined Integrations * By making integration hooks optional, Astro can now ignore null or undefined Integrations
* instead of giving an internal error most people can't read * instead of giving an internal error most people can't read

View file

@ -40,9 +40,9 @@ describe('Integration API', () => {
{ {
name: 'test', name: 'test',
hooks: { hooks: {
"astro:config:setup": ({ updateConfig }) => { 'astro:config:setup': ({ updateConfig }) => {
updateConfig({ site }); updateConfig({ site });
} },
}, },
}, },
], ],
@ -51,7 +51,7 @@ describe('Integration API', () => {
}); });
expect(updatedSettings.config.site).to.equal(site); expect(updatedSettings.config.site).to.equal(site);
}); });
it('runHookConfigSetup runs integrations added by another integration', async () => { it('runHookConfigSetup runs integrations added by another integration', async () => {
const site = 'https://test.com/'; const site = 'https://test.com/';
const updatedSettings = await runHookConfigSetup({ const updatedSettings = await runHookConfigSetup({
@ -62,19 +62,21 @@ describe('Integration API', () => {
{ {
name: 'test', name: 'test',
hooks: { hooks: {
"astro:config:setup": ({ updateConfig }) => { 'astro:config:setup': ({ updateConfig }) => {
updateConfig({ updateConfig({
integrations: [{ integrations: [
name: 'dynamically-added', {
hooks: { name: 'dynamically-added',
// eslint-disable-next-line @typescript-eslint/no-shadow hooks: {
"astro:config:setup": ({ updateConfig }) => { // eslint-disable-next-line @typescript-eslint/no-shadow
updateConfig({ site }); 'astro:config:setup': ({ updateConfig }) => {
} updateConfig({ site });
},
},
}, },
}], ],
}); });
} },
}, },
}, },
], ],
@ -84,7 +86,6 @@ describe('Integration API', () => {
expect(updatedSettings.config.site).to.equal(site); expect(updatedSettings.config.site).to.equal(site);
expect(updatedSettings.config.integrations.length).to.equal(2); expect(updatedSettings.config.integrations.length).to.equal(2);
}); });
}); });
describe('Astro feature map', function () { describe('Astro feature map', function () {