Skip to content

[Bug]: v30 beta.8 ignores testEnvironmentOptions.customExportConditions #15653

@anomiex

Description

@anomiex

Version

30.0.0-beta.8

Steps to reproduce

  1. Unzip this example repository: test.zip
  2. Run pnpm install
  3. Run pnpm --filter=a test (or cd a then pnpm test).

You can change the jest dependency version to ^29 or 30.0.0-beta.5 to see it pass.

Expected behavior

 PASS  tests/foo.test.js
  ✓ Test (2 ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        0.145 s, estimated 1 s
Ran all test suites.

Actual behavior

 FAIL  tests/foo.test.js
  ✕ Test (3 ms)

  ● Test

    expect(received).toBe(expected) // Object.is equality

    Expected: "src"
    Received: "built"

      2 |
      3 | test( 'Test', () => {
    > 4 |     expect( foo() ).toBe( 'src' );
        |                     ^
      5 | } );
      6 |

      at Object.toBe (tests/foo.test.js:4:21)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        0.2 s, estimated 1 s
Ran all test suites.
 ELIFECYCLE  Test failed. See above for more details.

Additional context

Probably #15619 missed passing the customExportConditions through to the new resolver.

Environment

System:
    OS: Linux 6.12 Debian GNU/Linux 13 (trixie) 13 (trixie)
    CPU: (16) x64 AMD Ryzen 7 7840U w/ Radeon  780M Graphics
  Binaries:
    Node: 22.16.0 - /usr/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.9.2 - /usr/bin/npm
    pnpm: 10.11.1 - /usr/local/bin/pnpm
  npmPackages:
    jest: 30.0.0-beta.8 => 30.0.0-beta.8

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions