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
This commit is contained in:
Paul Gschwendtner 2021-07-12 20:29:57 +02:00 committed by Andrew Kushnir
parent 9456eca7c5
commit 867000efcc
1 changed files with 6 additions and 1 deletions

View File

@ -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},