发布

  • fix(testing): keep ts-jest resolving exports-only libs on typescript < 6 (#36089)

    frostbyte_neo 发布于 2026-06-24 17:19:16 +00:00

    Current Behavior

    The jest-30 path of @nx/jest bumps ts-jest to 29.4.x. On the CommonJS
    jest path, ts-jest 29.2+ falls back to moduleResolution: node10 when
    bundler is invalid alongside the forced module: commonjs (TypeScript
    < 6). node10 ignores package exports maps, so workspace libraries
    that expose types only via exports fail with TS2307 during the ts-jest
    type check.

    Expected Behavior

    A new migration sets isolatedModules: true in tsconfig.spec.json for
    ts-jest projects on TypeScript < 6 ts-solution workspaces (that do not
    already enable it), so ts-jest transpiles per file and the cross-file
    type resolution no longer runs. TypeScript >= 6 (where bundler is
    valid with commonjs and resolves exports) is unaffected.

    Related Issue(s)

    NXC-4591


    View session information


    Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>

    下载附件