Skip to content

Commit 3349566

Browse files
committed
wip: Add additional dir for test case rendering
1 parent 593c372 commit 3349566

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

packages/cursorless-org/src/pages/component-sheet.tsx

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,17 @@ async function loadYamlFiles(dir: string, selectedFiles?: string[]) {
4141
export async function getStaticProps() {
4242
const itemsDirActions = path.join(fixturesDir, "actions");
4343
const itemsDirDecorations = path.join(fixturesDir, "decorations");
44+
const itemsDirInsertEmptyLines = path.join(
45+
fixturesDir,
46+
"actions/insertEmptyLines",
47+
);
4448

4549
const dataActions = await loadYamlFiles(itemsDirActions, testSelectedFiles);
50+
const dataInsertEmptyLines = await loadYamlFiles(
51+
itemsDirInsertEmptyLines,
52+
testSelectedFiles,
53+
);
54+
4655
const dataDecorations = await loadYamlFiles(
4756
itemsDirDecorations,
4857
testSelectedFiles,
@@ -52,17 +61,18 @@ export async function getStaticProps() {
5261

5362
const data = (
5463
await Promise.all(
55-
[...dataActions, ...dataDecorations].map(async (val) => {
56-
try {
57-
// const upgraded = upgrade(data);
58-
const fixture = await loadTestCaseFixture(val);
59-
return { ...fixture, raw: val };
60-
} catch (err) {
61-
console.error(err);
62-
data_errors.push(val);
63-
return null;
64-
}
65-
}),
64+
[...dataActions, ...dataDecorations, ...dataInsertEmptyLines].map(
65+
async (val) => {
66+
try {
67+
const fixture = await loadTestCaseFixture(val);
68+
return { ...fixture, raw: val };
69+
} catch (err) {
70+
console.error(err);
71+
data_errors.push(val);
72+
return null;
73+
}
74+
},
75+
),
6676
)
6777
).filter((test) => test !== undefined);
6878

0 commit comments

Comments
 (0)