Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: TypeError: Attempted to assign to readonly property when running tests in bun docker containers #15483

Open
rhufsky opened this issue Jan 31, 2025 · 0 comments

Comments

@rhufsky
Copy link

rhufsky commented Jan 31, 2025

Version

29.7.0

Steps to reproduce

Jest Tests fail when running via bun 1.2.1 in a docker container

FAIL src/__test__/add.test.ts
  Test suite failed to run

    TypeError: Attempted to assign to readonly property.

      at node_modules/jest-runtime/build/index.js:1638:6
      at forEach (native)
      at Object.<anonymous> (node_modules/stack-utils/index.js:10:9)
      at Object.<anonymous> (node_modules/expect/build/toThrowMatchers.js:9:30)
      at Object.<anonymous> (node_modules/expect/build/index.js:23:54)
      at _expect (node_modules/@jest/expect/build/index.js:8:22)
      at createJestExpect (node_modules/@jest/expect/build/index.js:29:9)
      at Object.<anonymous> (node_modules/@jest/expect/build/index.js:39:35)
      at processTicksAndRejections (native)
      at processTicksAndRejections (native)

Running bun run test locally or running in a node docker container works

docker run --rm -v $(pwd):/app -w /app node:22.12.0-alpine3.21 sh -c 'npm install && npm run test'

Expected behavior

Tests should run also in bun docker containers

Actual behavior

FAIL src/__test__/add.test.ts
  Test suite failed to run

    TypeError: Attempted to assign to readonly property.

      at node_modules/jest-runtime/build/index.js:1638:6
      at forEach (native)
      at Object.<anonymous> (node_modules/stack-utils/index.js:10:9)
      at Object.<anonymous> (node_modules/expect/build/toThrowMatchers.js:9:30)
      at Object.<anonymous> (node_modules/expect/build/index.js:23:54)
      at _expect (node_modules/@jest/expect/build/index.js:8:22)
      at createJestExpect (node_modules/@jest/expect/build/index.js:29:9)
      at Object.<anonymous> (node_modules/@jest/expect/build/index.js:39:35)
      at processTicksAndRejections (native)
      at processTicksAndRejections (native)

Additional context

No response

Environment

System:
    OS: macOS 15.2
    CPU: (8) arm64 Apple M1 Pro
  Binaries:
    Node: 22.13.1 - /opt/homebrew/opt/node@22/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.9.2 - /opt/homebrew/opt/node@22/bin/npm
    bun: 1.2.1 - /opt/homebrew/bin/bun
  npmPackages:
    jest: ^29.7.0 => 29.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant