Skip to content

Commit

Permalink
fix: comparing different URL objects now return false
Browse files Browse the repository at this point in the history
  • Loading branch information
tr1ckydev committed Nov 2, 2023
1 parent 728f112 commit 411524f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/expect-utils/src/jasmineUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ function eq(
// RegExps are compared by their source patterns and flags.
case '[object RegExp]':
return a.source === b.source && a.flags === b.flags;
// URLs are compared by their href property which contains the entire url string.
case '[object URL]':
return a.href === b.href;
}
if (typeof a !== 'object' || typeof b !== 'object') {
return false;
Expand Down

0 comments on commit 411524f

Please sign in to comment.