Skip to content

Commit 7c471f5

Browse files
committed
chore: add changelog, add tests and fixed typo
1 parent 411524f commit 7c471f5

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
- `[jest-circus, jest-expect, jest-snapshot]` Pass `test.failing` tests when containing failing snapshot matchers ([#14313](https://github.com/jestjs/jest/pull/14313))
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))
27+
- `[@jest/expect-utils]` Fix comparison of `URL` ([#14672](https://github.com/jestjs/jest/pull/14672))
2728
- `[jest-leak-detector]` Make leak-detector more aggressive when running GC ([#14526](https://github.com/jestjs/jest/pull/14526))
2829
- `[jest-runtime]` Properly handle re-exported native modules in ESM via CJS ([#14589](https://github.com/jestjs/jest/pull/14589))
2930
- `[jest-util]` Make sure `isInteractive` works in a browser ([#14552](https://github.com/jestjs/jest/pull/14552))

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
subsetEquality,
1818
typeEquality,
1919
} from '../utils';
20+
import { equals } from "../jasmineUtils";
2021

2122
describe('getPath()', () => {
2223
test('property exists', () => {
@@ -578,9 +579,21 @@ describe('arrayBufferEquality', () => {
578579
expect(arrayBufferEquality(a, b)).toBeTruthy();
579580
});
580581

581-
test('returns false when given matching DataView', () => {
582+
test('returns false when given non-matching DataView', () => {
582583
const a = new DataView(Uint8Array.from([1, 2, 3]).buffer);
583584
const b = new DataView(Uint8Array.from([3, 2, 1]).buffer);
584585
expect(arrayBufferEquality(a, b)).toBeFalsy();
585586
});
587+
588+
test('returns true when given matching URL', () => {
589+
const a = new URL("https://jestjs.io/");
590+
const b = new URL("https://jestjs.io/");
591+
expect(equals(a, b)).toBeTruthy();
592+
});
593+
594+
test('returns false when given non-matching URL', () => {
595+
const a = new URL("https://jestjs.io/docs/getting-started");
596+
const b = new URL("https://jestjs.io/docs/getting-started#using-babel");
597+
expect(equals(a, b)).toBeFalsy();
598+
});
586599
});

0 commit comments

Comments
 (0)