summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro/src/core/build/graph.ts4
-rw-r--r--packages/astro/test/css-order-layout.test.js9
2 files changed, 6 insertions, 7 deletions
diff --git a/packages/astro/src/core/build/graph.ts b/packages/astro/src/core/build/graph.ts
index d78c9baa4..2f7deac7f 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 5df2d0b0f..948f7975b 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');
});
});