Skip to content

[Bug]: Jest reports different URL objects as PASS. #14399

@tr1ckydev

Description

@tr1ckydev

Version

29.6.2-dev

Steps to reproduce

test('url test', () => {
    expect(new URL("https://jestjs.io/")).toEqual(new URL("https://jestjs.io/docs/getting-started"));
});

Expected behavior

I expect this test to FAIL.

Actual behavior

Jest reports this test as PASS.

Additional context

I have fixed this bug in this pr(#14398) which happens primarily in Node.js environment.

Environment

System:
    OS: Linux 6.4 CachyOS Linux
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
  Binaries:
    Node: 20.5.0 - /usr/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 9.8.1 - /usr/bin/npm
  npmPackages:
    jest: ^29.6.2 => 29.6.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions