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

Bug: expect comparing RegExp and Set is wrong #4511

Closed
marvinhagemeister opened this issue Mar 22, 2024 · 1 comment · Fixed by #4512
Closed

Bug: expect comparing RegExp and Set is wrong #4511

marvinhagemeister opened this issue Mar 22, 2024 · 1 comment · Fixed by #4512
Labels
bug Something isn't working needs triage

Comments

@marvinhagemeister
Copy link
Contributor

Describe the bug

The expect function compares class instances incorrectly.

Steps to Reproduce

import { expect } from "jsr:@std/expect";

Deno.test("expect bug", () => {
  // This should throw, but passes
  expect(/foo/).toEqual(new Set());
});

Expected behavior

The expect should throw because a RegExp instance isn't the same as a Set

Environment

  • OS: macOS 14.2.1
  • deno version: 1.41.3
  • std version: 0.220.1
@marvinhagemeister marvinhagemeister added bug Something isn't working needs triage labels Mar 22, 2024
@marvinhagemeister
Copy link
Contributor Author

marvinhagemeister commented Mar 22, 2024

Just checked, this works as expected in jest where it throws like you'd expect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant