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

fix(utils): fix object diff with getter only property #5466

Merged
merged 4 commits into from Apr 2, 2024

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Apr 1, 2024

Description

It looks like similar issues are handled in

but, it wasn't handling when getter only property case for forceOverwrite.

I checked Jest and they seem to have simpler code to do this writable clone, so I borrowed these lines for this PR's fix.
https://github.com/jestjs/jest/blob/1d682f21c7a35da4d3ab3a1436a357b980ebd0fa/packages/jest-matcher-utils/src/deepCyclicCopyReplaceable.ts#L101-L111

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Copy link

netlify bot commented Apr 1, 2024

Deploy Preview for fastidious-cascaron-4ded94 canceled.

Name Link
🔨 Latest commit 9c47b9c
🔍 Latest deploy log https://app.netlify.com/sites/fastidious-cascaron-4ded94/deploys/660b7120bf3483000894a5a2

@hi-ogawa hi-ogawa marked this pull request as ready for review April 2, 2024 02:33
@sheremet-va sheremet-va merged commit 366d97c into vitest-dev:main Apr 2, 2024
19 checks passed
@hi-ogawa hi-ogawa deleted the fix-diff-getter-only branch April 2, 2024 23:03
renovate bot added a commit to solid-design-system/solid that referenced this pull request Apr 11, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[vite-node](https://togithub.com/vitest-dev/vitest/blob/main/packages/vite-node#readme)
([source](https://togithub.com/vitest-dev/vitest/tree/HEAD/packages/vite-node))
| [`1.4.0` ->
`1.5.0`](https://renovatebot.com/diffs/npm/vite-node/1.4.0/1.5.0) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/vite-node/1.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/vite-node/1.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/vite-node/1.4.0/1.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/vite-node/1.4.0/1.5.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>vitest-dev/vitest (vite-node)</summary>

###
[`v1.5.0`](https://togithub.com/vitest-dev/vitest/releases/tag/v1.5.0)

[Compare
Source](https://togithub.com/vitest-dev/vitest/compare/v1.4.0...v1.5.0)

#####    🚀 Features

- Add configuration for diff truncation  -  by
[@&#8203;willieho](https://togithub.com/willieho) in
[vitest-dev/vitest#5073
and
[vitest-dev/vitest#5333
[<samp>(6797b)</samp>](https://togithub.com/vitest-dev/vitest/commit/6797b041)
- Remove unrelated noise from diff for toMatchObject()  -  by
[@&#8203;geersch](https://togithub.com/geersch) in
[vitest-dev/vitest#5364
[<samp>(99276)</samp>](https://togithub.com/vitest-dev/vitest/commit/99276399)
- Allow custom host for --inspect and --inspect-brk  -  by
[@&#8203;sheremet-va](https://togithub.com/sheremet-va) in
[vitest-dev/vitest#5509
[<samp>(61572)</samp>](https://togithub.com/vitest-dev/vitest/commit/6157282c)
- **coverage**: V8 to ignore empty lines, comments, types  -  by
[@&#8203;AriPerkkio](https://togithub.com/AriPerkkio) in
[vitest-dev/vitest#5457
[<samp>(10b89)</samp>](https://togithub.com/vitest-dev/vitest/commit/10b89713)

#####    🐞 Bug Fixes

- `describe` calls not taking generic type parameters  -  by
[@&#8203;aryaemami59](https://togithub.com/aryaemami59) in
[vitest-dev/vitest#5415
[<samp>(16bac)</samp>](https://togithub.com/vitest-dev/vitest/commit/16bacfab)
- Prevent hang when `process` is mocked  -  by
[@&#8203;AriPerkkio](https://togithub.com/AriPerkkio) in
[vitest-dev/vitest#5430
[<samp>(0ec4d)</samp>](https://togithub.com/vitest-dev/vitest/commit/0ec4d0e0)
- Don't check for "node:internal/console/" in console interceptor in
case the environment is not Node.js  -  by
[@&#8203;sheremet-va](https://togithub.com/sheremet-va)
[<samp>(87d36)</samp>](https://togithub.com/vitest-dev/vitest/commit/87d36a7a)
- The value received by toMatch should be a string  -  by
[@&#8203;btea](https://togithub.com/btea) in
[vitest-dev/vitest#5428
[<samp>(67485)</samp>](https://togithub.com/vitest-dev/vitest/commit/674851ca)
- Increase stack trace limit for location, don't hardcode suite position
 -  by [@&#8203;sheremet-va](https://togithub.com/sheremet-va) in
[vitest-dev/vitest#5518
[<samp>(04b23)</samp>](https://togithub.com/vitest-dev/vitest/commit/04b234d1)
-   **benchmark**:
- Run benchmark suites sequentially  -  by
[@&#8203;hi-ogawa](https://togithub.com/hi-ogawa) in
[vitest-dev/vitest#5444
[<samp>(1f548)</samp>](https://togithub.com/vitest-dev/vitest/commit/1f548340)
- Fix benchmark summary of single bench suite  -  by
[@&#8203;hi-ogawa](https://togithub.com/hi-ogawa) in
[vitest-dev/vitest#5489
[<samp>(db981)</samp>](https://togithub.com/vitest-dev/vitest/commit/db98145f)
- Table reporter for non TTY output  -  by
[@&#8203;hi-ogawa](https://togithub.com/hi-ogawa) in
[vitest-dev/vitest#5484
[<samp>(bea23)</samp>](https://togithub.com/vitest-dev/vitest/commit/bea234b1)
-   **expect**:
- Fix `toHaveBeenNthCalledWith` error message when not called  -  by
[@&#8203;hi-ogawa](https://togithub.com/hi-ogawa) in
[vitest-dev/vitest#5420
[<samp>(e5253)</samp>](https://togithub.com/vitest-dev/vitest/commit/e5253de4)
-   **types**:
- Pass correct type for suite factory  -  by
[@&#8203;sheremet-va](https://togithub.com/sheremet-va) in
[vitest-dev/vitest#5437
[<samp>(26718)</samp>](https://togithub.com/vitest-dev/vitest/commit/26718eb5)
-   **utils**:
- Fix object diff with getter only property  -  by
[@&#8203;hi-ogawa](https://togithub.com/hi-ogawa) in
[vitest-dev/vitest#5466
[<samp>(366d9)</samp>](https://togithub.com/vitest-dev/vitest/commit/366d97c3)
-   **vite-node**:
- Fix `isValidNodeImport` to check `"type": "module"` first  -  by
[@&#8203;hi-ogawa](https://togithub.com/hi-ogawa) in
[vitest-dev/vitest#5416
[<samp>(6fb15)</samp>](https://togithub.com/vitest-dev/vitest/commit/6fb15280)
-   **vitest**:
- Correctly send console events when state changes  -  by
[@&#8203;sheremet-va](https://togithub.com/sheremet-va)
[<samp>(3463f)</samp>](https://togithub.com/vitest-dev/vitest/commit/3463f9bb)
- Initiate FakeTimers on demand  -  by
[@&#8203;sheremet-va](https://togithub.com/sheremet-va) in
[vitest-dev/vitest#5450
[<samp>(e4e93)</samp>](https://togithub.com/vitest-dev/vitest/commit/e4e939ba)
- Check unhighlighted code for code frame line limit  -  by
[@&#8203;hi-ogawa](https://togithub.com/hi-ogawa) in
[vitest-dev/vitest#5465
[<samp>(6ae7e)</samp>](https://togithub.com/vitest-dev/vitest/commit/6ae7eaa2)
- Correctly filter by parent folder  -  by
[@&#8203;sheremet-va](https://togithub.com/sheremet-va) in
[vitest-dev/vitest#5408
[<samp>(91b06)</samp>](https://togithub.com/vitest-dev/vitest/commit/91b06cce)
- Close inspector immediately if run is canceled  -  by
[@&#8203;sheremet-va](https://togithub.com/sheremet-va) in
[vitest-dev/vitest#5519
[<samp>(b8006)</samp>](https://togithub.com/vitest-dev/vitest/commit/b80062d7)
-   **workspace**:
- Set CWD to config directory, allow overriding local .env  -  by
[@&#8203;sheremet-va](https://togithub.com/sheremet-va) in
[vitest-dev/vitest#5476
[<samp>(d4003)</samp>](https://togithub.com/vitest-dev/vitest/commit/d4003882)

#####     [View changes on
GitHub](https://togithub.com/vitest-dev/vitest/compare/v1.4.0...v1.5.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 5am every weekday" in timezone
Europe/Berlin, Automerge - "after 10pm every weekday,before 5am every
weekday" in timezone Europe/Berlin.

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/solid-design-system/solid).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tries to assign to a getter-only field when formatting an error
2 participants