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

Tests start failing when upgrading from 1.5.2 to 1.5.3 #5688

Closed
6 tasks done
osmestad opened this issue May 8, 2024 · 2 comments · Fixed by #5692
Closed
6 tasks done

Tests start failing when upgrading from 1.5.2 to 1.5.3 #5688

osmestad opened this issue May 8, 2024 · 2 comments · Fixed by #5692
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@osmestad
Copy link

osmestad commented May 8, 2024

Describe the bug

For our code base a lot of tests start failing when upgrading from 1.5.2 to 1.5.3 or 1.6.0. It seems to relate to deep object comparison where we use Immutable.js. I'm guessing, but maybe related to this change: #5621?

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-qtcox7?file=test%2Fim.test.ts

System Info

Any? at least on Macs and Linux and Stackblitz :-)

Used Package Manager

yarn

Validations

@hi-ogawa
Copy link
Contributor

hi-ogawa commented May 9, 2024

I checked the repro and they have different _tail.ownerID, so that's now caught by #5621.

Just tried a simpler repro and I got this
https://stackblitz.com/edit/vitest-dev-vitest-tybjr1?file=test%2Fim.test.ts

import { expect, test } from 'vitest';
import * as im from 'immutable';

test('repro', () => {
  const x = im.List([{ x: 1 }]);
  const y = im.List([1]).map(i => ({ x: i }));
  console.log("[x._tail]", x._tail); // [x._tail] VNode { array: [ { x: 1 } ], ownerID: undefined }
  console.log("[y._tail]", y._tail); // [y._tail] VNode { array: [ { x: 1 } ], ownerID: OwnerID {} }
  expect(x).toEqual(y);
});

Since message says "Compared values have no visual difference.", probably we need to do something special for immutable js for iterator checks too. Perhaps we can check how Jest is dealing with this.

EDIT: Just confirmed the same test doesn't fail on Jest https://github.com/hi-ogawa/reproductions/tree/main/jest-immutable

@hi-ogawa hi-ogawa added p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels May 9, 2024
@osmestad
Copy link
Author

Thanks for the quick fix!

@github-actions github-actions bot locked and limited conversation to collaborators May 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants