From 867000efcc3b5802dd4745be60b951ac11d71d7b Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 12 Jul 2021 20:29:57 +0200 Subject: [PATCH] fix(dev-infra): do not include all types in api golden test (#42828) The API golden test tool should not include all types from the `node_modules/`. This results in unnecessary type resolution when the API golden tool is run outside of sandbox (i.e. on windows or with `bazel run` for accept). PR Close #42828 --- dev-infra/bazel/api-golden/test_api_report.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dev-infra/bazel/api-golden/test_api_report.ts b/dev-infra/bazel/api-golden/test_api_report.ts index 6261ce6739..d840964571 100644 --- a/dev-infra/bazel/api-golden/test_api_report.ts +++ b/dev-infra/bazel/api-golden/test_api_report.ts @@ -41,7 +41,12 @@ export async function testApiGolden( const tempDir = process.env.TEST_TMPDIR ?? process.cwd(); const configObject: IConfigFile = { - compiler: {overrideTsconfig: {files: [indexFilePath]}}, + compiler: { + overrideTsconfig: + // We disable inclusion of all `@types` installed as this throws-off API reports + // and causes different goldens when the API test is run outside sandbox. + {files: [indexFilePath], compilerOptions: {types: [], lib: ['esnext', 'dom']}} + }, projectFolder: dirname(packageJsonPath), mainEntryPointFilePath: indexFilePath, dtsRollup: {enabled: false},