Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

test(cli): integration fixtures carry their own TypeScript config, so a prop check reads the fixture, not the repository (#9075)

Christopher Chedeau340cc7c8c079
diff --git a/packages/cli/api/integration/authoring-checks.test.mjs b/packages/cli/api/integration/authoring-checks.test.mjs
index 25676b8dc5..97d9750f5f 100644
--- a/packages/cli/api/integration/authoring-checks.test.mjs
+++ b/packages/cli/api/integration/authoring-checks.test.mjs
@@ -147,6 +147,14 @@ beforeEach(() => {
tmpDir = fs.mkdtempSync(
path.join(process.cwd(), '.astryx-template-conflicts-'),
);
+ // The fixture is a package with its own TypeScript config, scoped to its
+ // own files. Without one, the prop check reads the repository's root
+ // config, as `tsc` would for a folder inside it, and compiles every
+ // declaration in the repository for each check.
+ fs.writeFileSync(
+ path.join(tmpDir, 'tsconfig.json'),
+ `${JSON.stringify({extends: '../tsconfig.json', include: ['**/*']})}\n`,
+ );
});
afterEach(() => {
diff --git a/packages/cli/api/integration/validate-integration-gaps.test.mjs b/packages/cli/api/integration/validate-integration-gaps.test.mjs
index 63e94ff6f5..82c429879e 100644
--- a/packages/cli/api/integration/validate-integration-gaps.test.mjs
+++ b/packages/cli/api/integration/validate-integration-gaps.test.mjs
@@ -45,6 +45,14 @@ const CLI = path.join(
beforeEach(() => {
tmpDir = fs.mkdtempSync(path.join(process.cwd(), '.astryx-validate-gaps-'));
+ // The fixture is a package with its own TypeScript config, scoped to its
+ // own files. Without one, the prop check reads the repository's root
+ // config, as `tsc` would for a folder inside it, and compiles every
+ // declaration in the repository for each check.
+ fs.writeFileSync(
+ path.join(tmpDir, 'tsconfig.json'),
+ `${JSON.stringify({extends: '../tsconfig.json', include: ['**/*']})}\n`,
+ );
});
afterEach(() => {