[ci] format
This commit is contained in:
parent
8bbdcf17dd
commit
86d5479c6f
2 changed files with 5 additions and 3 deletions
|
@ -17,7 +17,7 @@ export function* walkParentInfos(
|
||||||
if (info) {
|
if (info) {
|
||||||
if (childId) {
|
if (childId) {
|
||||||
const idx = info.importedIds.indexOf(childId);
|
const idx = info.importedIds.indexOf(childId);
|
||||||
if(idx === -1) {
|
if (idx === -1) {
|
||||||
// Dynamic imports come after all normal imports. So first add the number of normal imports.
|
// Dynamic imports come after all normal imports. So first add the number of normal imports.
|
||||||
order += info.importedIds.length;
|
order += info.importedIds.length;
|
||||||
// Then add on the dynamic ones.
|
// Then add on the dynamic ones.
|
||||||
|
@ -26,7 +26,7 @@ export function* walkParentInfos(
|
||||||
order += idx;
|
order += idx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
yield [info, depth, order];
|
yield [info, depth, order];
|
||||||
}
|
}
|
||||||
if (until?.(id)) return;
|
if (until?.(id)) return;
|
||||||
|
|
|
@ -120,7 +120,9 @@ describe('CSS ordering - import order', () => {
|
||||||
|
|
||||||
it('dynamic imports taken into account', async () => {
|
it('dynamic imports taken into account', async () => {
|
||||||
let html = await fixture.readFile('/one/index.html');
|
let html = await fixture.readFile('/one/index.html');
|
||||||
const content = await Promise.all(getLinks(html).map((href) => getLinkContent(href, fixture)));
|
const content = await Promise.all(
|
||||||
|
getLinks(html).map((href) => getLinkContent(href, fixture))
|
||||||
|
);
|
||||||
let [link1, link2] = content;
|
let [link1, link2] = content;
|
||||||
expect(link1.css).to.contain('aliceblue');
|
expect(link1.css).to.contain('aliceblue');
|
||||||
expect(link2.css).to.contain('yellow');
|
expect(link2.css).to.contain('yellow');
|
||||||
|
|
Loading…
Add table
Reference in a new issue