[ci] format

This commit is contained in:
matthewp 2022-12-06 22:14:29 +00:00 committed by fredkbot
parent 795f00f73c
commit a72a131e22
2 changed files with 6 additions and 7 deletions

View file

@ -14,8 +14,8 @@ export function* walkParentInfos(
seen.add(id); seen.add(id);
const info = ctx.getModuleInfo(id); const info = ctx.getModuleInfo(id);
if (info) { if (info) {
if(childId) { if (childId) {
order += info.importedIds.indexOf(childId) order += info.importedIds.indexOf(childId);
} }
yield [info, depth, order]; yield [info, depth, order];
} }

View file

@ -43,20 +43,19 @@ describe('CSS ordering - import order with layouts', () => {
it('Page level CSS is defined lower in the page', async () => { it('Page level CSS is defined lower in the page', async () => {
let html = await fixture.readFile('/index.html'); let html = await fixture.readFile('/index.html');
const content = await Promise.all(getLinks(html).map((href) => getLinkContent(href))); const content = await Promise.all(getLinks(html).map((href) => getLinkContent(href)));
let specialButtonCSS = -1; let specialButtonCSS = -1;
let globalCSS = -1; let globalCSS = -1;
for(let i = 0; i < content.length; i++) { for (let i = 0; i < content.length; i++) {
if(content[i].css.indexOf('.SpecialButton') !== -1) { if (content[i].css.indexOf('.SpecialButton') !== -1) {
specialButtonCSS = i; specialButtonCSS = i;
} else if(content[i].css.indexOf('green') !== -1) { } else if (content[i].css.indexOf('green') !== -1) {
globalCSS = i; 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'); expect(specialButtonCSS).to.equal(1, 'component level css sorted last');
}); });
}); });