summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar matthewp <matthewp@users.noreply.github.com> 2022-12-06 22:14:29 +0000
committerGravatar fredkbot <fred+astrobot@astro.build> 2022-12-06 22:14:29 +0000
commita72a131e22ad3e4812c0060dfc076f194bee9c90 (patch)
tree46cb40e023403507e7b4d39437f935af949e736f
parent795f00f73c549727e05d5b7bf0e39cce87add4e7 (diff)
downloadastro-a72a131e22ad3e4812c0060dfc076f194bee9c90.tar.gz
astro-a72a131e22ad3e4812c0060dfc076f194bee9c90.tar.zst
astro-a72a131e22ad3e4812c0060dfc076f194bee9c90.zip
[ci] format
-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');
});
});