Skip to content

Commit d2ebca4

Browse files
authored
Merge branch 'main' into fix-child-circular-result
2 parents b06be16 + d89bdaf commit d2ebca4

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
- `[jest-config]` Make sure to respect `runInBand` option ([#14578](https://github.com/facebook/jest/pull/14578))
2626
- `[@jest/expect-utils]` Fix comparison of `DataView` ([#14408](https://github.com/jestjs/jest/pull/14408))
2727
- `[@jest/expect-utils]` [**BREAKING**] exclude non-enumerable in object matching ([#14670](https://github.com/jestjs/jest/pull/14670))
28+
- `[@jest/expect-utils]` Fix comparison of `URL` ([#14672](https://github.com/jestjs/jest/pull/14672))
2829
- `[jest-leak-detector]` Make leak-detector more aggressive when running GC ([#14526](https://github.com/jestjs/jest/pull/14526))
2930
- `[jest-runtime]` Properly handle re-exported native modules in ESM via CJS ([#14589](https://github.com/jestjs/jest/pull/14589))
3031
- `[jest-util]` Make sure `isInteractive` works in a browser ([#14552](https://github.com/jestjs/jest/pull/14552))
@@ -53,6 +54,7 @@
5354
- `[jest-config, @jest/core, jest-util]` Upgrade `ci-info` ([#14655](https://github.com/jestjs/jest/pull/14655))
5455
- `[jest-mock]` [**BREAKING**] Remove `MockFunctionMetadataType`, `MockFunctionMetadata` and `SpyInstance` types ([#14621](https://github.com/jestjs/jest/pull/14621))
5556
- `[jest-transform]` Upgrade `write-file-atomic` ([#14274](https://github.com/jestjs/jest/pull/14274))
57+
- `[jest-util]` Upgrade `picomatch` to v3 ([#14653](https://github.com/jestjs/jest/pull/14653))
5658

5759
## 29.7.0
5860

packages/expect-utils/src/__tests__/utils.test.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import {List, OrderedMap, OrderedSet, Record} from 'immutable';
1010
import {stringify} from 'jest-matcher-utils';
11+
import {equals} from '../jasmineUtils';
1112
import {
1213
arrayBufferEquality,
1314
emptyObject,
@@ -623,9 +624,21 @@ describe('arrayBufferEquality', () => {
623624
expect(arrayBufferEquality(a, b)).toBeTruthy();
624625
});
625626

626-
test('returns false when given matching DataView', () => {
627+
test('returns false when given non-matching DataView', () => {
627628
const a = new DataView(Uint8Array.from([1, 2, 3]).buffer);
628629
const b = new DataView(Uint8Array.from([3, 2, 1]).buffer);
629630
expect(arrayBufferEquality(a, b)).toBeFalsy();
630631
});
632+
633+
test('returns true when given matching URL', () => {
634+
const a = new URL('https://jestjs.io/');
635+
const b = new URL('https://jestjs.io/');
636+
expect(equals(a, b)).toBeTruthy();
637+
});
638+
639+
test('returns false when given non-matching URL', () => {
640+
const a = new URL('https://jestjs.io/docs/getting-started');
641+
const b = new URL('https://jestjs.io/docs/getting-started#using-babel');
642+
expect(equals(a, b)).toBeFalsy();
643+
});
631644
});

packages/expect-utils/src/jasmineUtils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ function eq(
125125
// RegExps are compared by their source patterns and flags.
126126
case '[object RegExp]':
127127
return a.source === b.source && a.flags === b.flags;
128+
// URLs are compared by their href property which contains the entire url string.
129+
case '[object URL]':
130+
return a.href === b.href;
128131
}
129132
if (typeof a !== 'object' || typeof b !== 'object') {
130133
return false;

packages/jest-util/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"chalk": "^4.0.0",
2525
"ci-info": "^4.0.0",
2626
"graceful-fs": "^4.2.9",
27-
"picomatch": "^2.2.3"
27+
"picomatch": "^3.0.0"
2828
},
2929
"devDependencies": {
3030
"@types/graceful-fs": "^4.1.3",

yarn.lock

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13437,7 +13437,7 @@ __metadata:
1343713437
chalk: ^4.0.0
1343813438
ci-info: ^4.0.0
1343913439
graceful-fs: ^4.2.9
13440-
picomatch: ^2.2.3
13440+
picomatch: ^3.0.0
1344113441
languageName: unknown
1344213442
linkType: soft
1344313443

@@ -17403,6 +17403,13 @@ __metadata:
1740317403
languageName: node
1740417404
linkType: hard
1740517405

17406+
"picomatch@npm:^3.0.0":
17407+
version: 3.0.0
17408+
resolution: "picomatch@npm:3.0.0"
17409+
checksum: a55ddf301a3b817463f4fad841573be9c8efc33472359b641dcaef3069db78ed8c4924c499c8b9e06af406f426732458bd1ae90222eb346e9c4547491dcc05ae
17410+
languageName: node
17411+
linkType: hard
17412+
1740617413
"pify@npm:^2.3.0":
1740717414
version: 2.3.0
1740817415
resolution: "pify@npm:2.3.0"

0 commit comments

Comments
 (0)