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

Assertion error message gets the test to fail when using sub-properties with descriptor property writable: false #4277

Closed
6 tasks done
bfamchon opened this issue Oct 9, 2023 · 0 comments · Fixed by #4278

Comments

@bfamchon
Copy link
Contributor

bfamchon commented Oct 9, 2023

Describe the bug

I'm using Vite & Vitest with the default configuration.

I saw the #3421 issues and notice that when using sub-properties with writable: false, error was the same as before: Cannot assign to read only property 'sub_properties' of object '#<Object>'.

I assume that this bug is due to options not being passed to the recursive calls of clone function here and here

I made the following stackblitz to explain my case and open a pull-request.

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-xce9r7?file=package.json,test%2Fbug.test.ts

System Info

System:
    OS: Linux 3.10 CentOS Linux 7 (Core)
    CPU: (8) x64 Intel(R) Core(TM) i5-8400H CPU @ 2.50GHz
    Memory: 5.31 GB / 15.47 GB
    Container: Yes
    Shell: 4.2.46 - /bin/bash
  Binaries:
    Node: 16.20.1 - ~/.volta/tools/image/node/16.20.1/bin/node
    Yarn: 4.0.0-rc.40 - ~/.volta/tools/image/yarn/4.0.0-rc.40/bin/yarn
    npm: 8.19.4 - ~/.volta/tools/image/node/16.20.1/bin/npm
    pnpm: 7.29.3 - ~/.volta/bin/pnpm
  Browsers:
    Chrome: 117.0.5938.149
  npmPackages:
    @vitejs/plugin-react-swc: ^3.4.0 => 3.4.0 
    vite: ^4.4.10 => 4.4.10 
    vitest: ^0.34.6 => 0.34.6

Used Package Manager

npm

Validations

@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant