Skip to content

chore(tests): centralise TypeScript test configuration - #5695

Merged
svozza merged 3 commits into
mainfrom
chore/5694-shared-test-tsconfig
Sep 11, 2026
Merged

svozza merged 3 commits into
mainfrom
chore/5694-shared-test-tsconfig

Conversation

@svozza

@svozza svozza commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Centralise test compiler settings and shared setup declarations so all 16 test projects inherit one configuration. Test type-checking now uses its own incremental caches instead of reusing production build caches.

Changes

  • Add tsconfig.test.json, extending the root compiler configuration with test-only overrides, shared setupEnv.ts inclusion, and ${configDir} paths for package sources and tests.
  • Disable composite/declaration output for test projects while retaining incremental checking in each workspace's .tsbuildinfo/tests.json.
  • Reduce package test configs to the shared base while retaining Kafka's JSON-module override.
  • Preserve the layer tests' existing compiler behaviour: allowImportingTsExtensions and resolveJsonModule were previously inherited from layers/tsconfig.json. They are now explicit in layers/tests/tsconfig.json because it extends the shared test base. Its existing include list, including layers/package.json, is unchanged.
  • Remove the matcher type test's explicit setup import to verify inherited declarations, and document the configuration conventions.

Validation passed: clean ESM/CJS rebuilds, workspace and layer type-checks, all Vitest type suites, 3,718 unit tests with 100% coverage, and the layer-packaging unit test. Comparison of 48 resolved configurations confirmed no existing input files were dropped; compiler probes verified matcher typing and root-option inheritance across all 16 test projects. All 1,812 production output/cache hashes remained unchanged.

Type-check timings were effectively unchanged: 52.2 → 51.7 seconds cold and 41.1 → 41.1 seconds cached in a single before/after sample.

Issue number: closes #5694


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

Share compiler options, setup declarations and package-relative test inputs while isolating incremental test caches from production builds.

Closes #5694

@dreamorosi dreamorosi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one!

@svozza
svozza merged commit 3919a3c into main Sep 11, 2026
41 checks passed
@svozza
svozza deleted the chore/5694-shared-test-tsconfig branch September 11, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L PRs between 100-499 LOC

2 participants