-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Wrong comparison of Option with vitest's expect(...).not.toStrictEqual(...) #2614
Comments
Started playing with it in the effect codebase and seems like the expect(_.some(1)).toStrictEqual(_.some(2))
expect(_.none()).toStrictEqual(_.some(2)) |
Okay, seems to be the
When I remove it from the Effect prototype the comparison starts working. cc @mikearnaldi |
Yup that comes from 3.0.4, I don't see how this could ever be considered a bug of effect, it's behaviour of expect... |
The Effect way of comparing options is |
In this codebase you rely on the |
Yeah but that's a bug in expect not in Effect... like I am trying to compare two objects with |
seems like a vitest issue, jest had a similar jestjs/jest#8280 |
The following works: import { jestExpect as expect } from "@jest/expect"
import { describe, it } from "vitest"
describe("Vitest Issue", () => {
it("compares", () => {
const a = {
value: 0,
[Symbol.iterator]: [0, 1, 2, Math.random()][Symbol.iterator]
}
const b = {
value: 1,
[Symbol.iterator]: [0, 1, 2, Math.random()][Symbol.iterator]
}
expect(a).toStrictEqual(b)
})
}) |
What version of Effect is running?
3.0.5
What steps can reproduce the bug?
https://stackblitz.com/edit/stackblitz-starters-8c4cgb?file=index.test.ts
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
3.0.4 and 3.0.5 seems to be affected, works correctly in 3.0.3
The text was updated successfully, but these errors were encountered: