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 Aug 10, 2023
1 parent 0fd5b1c commit 2a917c5
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 2a917c5

Please sign in to comment.