Skip to content

Commit bbb7758

Browse files
[jasmine] Add support for passing DiffBuilder as the third argument to v3 (DefinitelyTyped#66391)
This was added in v3.99 to ease the transition to v4.0 https://jasmine.github.io/tutorials/upgrading_to_Jasmine_4.0#tips-for-resolving-specific-deprecation-warnings
1 parent b8f543f commit bbb7758

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

types/jasmine/v3/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ declare namespace jasmine {
494494

495495
interface MatchersUtil {
496496
equals(a: any, b: any, customTesters?: ReadonlyArray<CustomEqualityTester>, diffBuilder?: DiffBuilder): boolean;
497+
equals(a: any, b: any, diffBuilder?: DiffBuilder): boolean;
497498
contains<T>(
498499
haystack: ArrayLike<T> | string,
499500
needle: any,

types/jasmine/v3/jasmine-tests.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,11 @@ describe("DiffBuilder", () => {
13021302
jasmine.matchersUtil.equals(1, 1, undefined, differ);
13031303
});
13041304

1305+
it("can be passed to matchersUtil.equals as the third argument", () => {
1306+
const differ = jasmine.DiffBuilder();
1307+
jasmine.matchersUtil.equals(1, 1, differ);
1308+
});
1309+
13051310
it("records the actual and expected objects", () => {
13061311
const diffBuilder = jasmine.DiffBuilder();
13071312
diffBuilder.setRoots({ x: "actual" }, { x: "expected" });

0 commit comments

Comments
 (0)