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

Latest version of tinyspy (3.0.1) causes a Cannot redefine property: mock when trying to spyOn an object multiple times #6465

Closed
6 tasks done
vladfrangu opened this issue Sep 9, 2024 · 2 comments · Fixed by #6464

Comments

@vladfrangu
Copy link

Describe the bug

Renovate caught this issue in our CI (apify/apify-cli#636). It seems like the latest version of tinyspy (3.0.1) causes some issues when trying to spy on and mock an object's method multiple times. This issue doesn't repro on tinyspy 3.0.0 (and somehow I was also unable to reproduce this with tinyspy directly...)

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-uuvjoy

System Info

System:
    OS: macOS 15.0
    CPU: (10) arm64 Apple M1 Max
    Memory: 150.05 MB / 32.00 GB
    Shell: 5.9 - /opt/homebrew/bin/zsh
  Binaries:
    Node: 20.17.0 - ~/.volta/tools/image/node/20.17.0/bin/node
    Yarn: 4.4.1 - ~/.volta/tools/image/yarn/4.4.1/bin/yarn
    npm: 10.8.2 - ~/.volta/tools/image/node/20.17.0/bin/npm
    bun: 1.1.26 - ~/.bun/bin/bun
  Browsers:
    Chrome: 128.0.6613.120
    Safari: 18.0
  npmPackages:
    vitest: ^2.0.5 => 2.0.5

Used Package Manager

yarn

Validations

@vladkrasn
Copy link

Yup, getting this in my ci too. Typescript's intellisense also doesn't pickup import

@sheremet-va
Copy link
Member

Reverted the change in [email protected], so renovate shouldn't pick it up again. The change instead will be published as 4.0.0.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 24, 2024
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.

3 participants