aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts/src/test_installation.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/monorepo-scripts/src/test_installation.ts')
-rw-r--r--packages/monorepo-scripts/src/test_installation.ts12
1 files changed, 5 insertions, 7 deletions
diff --git a/packages/monorepo-scripts/src/test_installation.ts b/packages/monorepo-scripts/src/test_installation.ts
index be39b1878..a642498ac 100644
--- a/packages/monorepo-scripts/src/test_installation.ts
+++ b/packages/monorepo-scripts/src/test_installation.ts
@@ -104,13 +104,10 @@ async function testInstallPackageAsync(
const packageName = installablePackage.packageJson.name;
utils.log(`Testing ${packageName}@${lastChangelogVersion}`);
const packageDirName = path.join(...(packageName + '-test').split('/'));
- const testDirectory = path.join(
- monorepoRootPath,
- 'packages',
- 'monorepo-scripts',
- '.installation-test',
- packageDirName,
- );
+ // NOTE(fabio): The `testDirectory` needs to be somewhere **outside** the monorepo root directory.
+ // Otherwise, it will have access to the hoisted `node_modules` directory and the Typescript missing
+ // type errors will not be caught.
+ const testDirectory = path.join(monorepoRootPath, '..', '.installation-test', packageDirName);
await rimrafAsync(testDirectory);
await mkdirpAsync(testDirectory);
await execAsync('yarn init --yes', { cwd: testDirectory });
@@ -132,6 +129,7 @@ async function testInstallPackageAsync(
noImplicitReturns: true,
pretty: true,
strict: true,
+ resolveJsonModule: true,
},
include: ['index.ts'],
};