diff --git a/packages/astro/src/core/build/graph.ts b/packages/astro/src/core/build/graph.ts index d78c9baa41..2f7deac7fe 100644 --- a/packages/astro/src/core/build/graph.ts +++ b/packages/astro/src/core/build/graph.ts @@ -14,8 +14,8 @@ export function* walkParentInfos( seen.add(id); const info = ctx.getModuleInfo(id); if (info) { - if(childId) { - order += info.importedIds.indexOf(childId) + if (childId) { + order += info.importedIds.indexOf(childId); } yield [info, depth, order]; } diff --git a/packages/astro/test/css-order-layout.test.js b/packages/astro/test/css-order-layout.test.js index 5df2d0b0f7..948f7975bf 100644 --- a/packages/astro/test/css-order-layout.test.js +++ b/packages/astro/test/css-order-layout.test.js @@ -43,20 +43,19 @@ describe('CSS ordering - import order with layouts', () => { it('Page level CSS is defined lower in the page', async () => { let html = await fixture.readFile('/index.html'); - const content = await Promise.all(getLinks(html).map((href) => getLinkContent(href))); let specialButtonCSS = -1; let globalCSS = -1; - for(let i = 0; i < content.length; i++) { - if(content[i].css.indexOf('.SpecialButton') !== -1) { + for (let i = 0; i < content.length; i++) { + if (content[i].css.indexOf('.SpecialButton') !== -1) { specialButtonCSS = i; - } else if(content[i].css.indexOf('green') !== -1) { + } else if (content[i].css.indexOf('green') !== -1) { globalCSS = i; } } - expect(globalCSS).to.equal(0, 'global css sorted on top') + expect(globalCSS).to.equal(0, 'global css sorted on top'); expect(specialButtonCSS).to.equal(1, 'component level css sorted last'); }); });