Skip to content

fix(test): pin toolchain in package-integrity fixtures - #2055

Closed
aemada-aws wants to merge 1 commit into
mainfrom
fix/pin-integrity-fixture-toolchain
Closed

aemada-aws wants to merge 1 commit into
mainfrom
fix/pin-integrity-fixture-toolchain

Conversation

@aemada-aws

Copy link
Copy Markdown
Contributor

Problem

chore(deps) dependency-upgrade PRs (e.g. #2054) are stuck — the required build check fails on the package-integrity test suite (lib/__tests__/package-integrity/handler/integrity.test.ts: happy jsii, unhappy npm jsii, unhappy pypi jsii, happy ts).

These tests scaffold throwaway projen projects and run npx projen build inside them. The fixture .projenrc.js files pin no versions, so projen generates:

"typescript": "*",
"jest": "*",
"ts-jest": "*"

which resolve the latest published versions at test time. TypeScript 7.0.2 now resolves via *, but ts-jest@29 only supports typescript ">=4.3 <6". The nested build therefore crashes:

TypeError: Cannot read properties of undefined (reading 'readFile')
  at ConfigSet._resolveTsConfig (node_modules/ts-jest/dist/legacy/config/config-set.js:519:76)

No dist/ is produced, so the outer assertions fail with ENOENT ... /dist. This is repo-wide (affects main and every open PR), not specific to any dependency bump.

Fix

Pin the scaffolded projects to a compatible combination in both fixtures:

typescriptVersion: '~5.8.0',
jestOptions: { jestVersion: '^29' },
devDeps: ['ts-jest@^29'],

Validation

Reproduced locally: with * ranges → typescript 7.0.2 + ts-jest 29.4.11 → readFile crash. After pinning → typescript 5.8.3 + jest 29.7.0 + ts-jest 29.4.11, and the scaffolded project's test step passes (Test Suites: 1 passed). CI will exercise the full npx projen build in the integrity suite.

The package-integrity tests scaffold projen projects and run
`npx projen build` inside them. The fixtures pinned no versions, so
projen generated "typescript": "*", "jest": "*" and "ts-jest": "*",
resolving the latest published versions at test time.

TypeScript 7.x now resolves via "*" and is incompatible with ts-jest 29
(peer typescript ">=4.3 <6"), so the nested build crashes with
"Cannot read properties of undefined (reading 'readFile')" in
ConfigSet._resolveTsConfig, producing no dist/ and failing the suite.

Pin the scaffolded projects to a compatible combination
(typescript ~5.8.0, jest ^29, ts-jest ^29) so the integrity tests build
deterministically and stop blocking the auto dependency-upgrade PRs.
@aemada-aws aemada-aws closed this Jul 20, 2026
auto-merge was automatically disabled July 20, 2026 14:22

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant