mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
Require read-only testers for matchers util (#39009)
This commit is contained in:
committed by
Armando Aguirre
parent
94751f2fda
commit
b7d7813c5d
Vendored
+3
-3
@@ -327,7 +327,7 @@ declare namespace jasmine {
|
||||
negativeCompare?(actual: any, ...expected: any[]): CustomMatcherResult;
|
||||
}
|
||||
|
||||
type CustomMatcherFactory = (util: MatchersUtil, customEqualityTesters: CustomEqualityTester[]) => CustomMatcher;
|
||||
type CustomMatcherFactory = (util: MatchersUtil, customEqualityTesters: ReadonlyArray<CustomEqualityTester>) => CustomMatcher;
|
||||
|
||||
interface CustomMatcherFactories {
|
||||
[index: string]: CustomMatcherFactory;
|
||||
@@ -339,8 +339,8 @@ declare namespace jasmine {
|
||||
}
|
||||
|
||||
interface MatchersUtil {
|
||||
equals(a: any, b: any, customTesters?: CustomEqualityTester[]): boolean;
|
||||
contains<T>(haystack: ArrayLike<T> | string, needle: any, customTesters?: CustomEqualityTester[]): boolean;
|
||||
equals(a: any, b: any, customTesters?: ReadonlyArray<CustomEqualityTester>): boolean;
|
||||
contains<T>(haystack: ArrayLike<T> | string, needle: any, customTesters?: ReadonlyArray<CustomEqualityTester>): boolean;
|
||||
buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: any[]): string;
|
||||
}
|
||||
|
||||
|
||||
@@ -917,10 +917,10 @@ describe("jasmine.any", () => {
|
||||
});
|
||||
|
||||
describe('custom asymmetry', function() {
|
||||
const tester = {
|
||||
asymmetricMatch: (actual: string) => {
|
||||
const tester: jasmine.AsymmetricMatcher<string> = {
|
||||
asymmetricMatch: (actual: string, customTesters) => {
|
||||
const secondValue = actual.split(',')[1];
|
||||
return secondValue === 'bar';
|
||||
return jasmine.matchersUtil.equals(secondValue, 'bar', customTesters);
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Vendored
+3
-3
@@ -329,7 +329,7 @@ declare namespace jasmine {
|
||||
negativeCompare?(actual: any, ...expected: any[]): CustomMatcherResult;
|
||||
}
|
||||
|
||||
type CustomMatcherFactory = (util: MatchersUtil, customEqualityTesters: CustomEqualityTester[]) => CustomMatcher;
|
||||
type CustomMatcherFactory = (util: MatchersUtil, customEqualityTesters: ReadonlyArray<CustomEqualityTester>) => CustomMatcher;
|
||||
|
||||
interface CustomMatcherFactories {
|
||||
[index: string]: CustomMatcherFactory;
|
||||
@@ -341,8 +341,8 @@ declare namespace jasmine {
|
||||
}
|
||||
|
||||
interface MatchersUtil {
|
||||
equals(a: any, b: any, customTesters?: CustomEqualityTester[]): boolean;
|
||||
contains<T>(haystack: ArrayLike<T> | string, needle: any, customTesters?: CustomEqualityTester[]): boolean;
|
||||
equals(a: any, b: any, customTesters?: ReadonlyArray<CustomEqualityTester>): boolean;
|
||||
contains<T>(haystack: ArrayLike<T> | string, needle: any, customTesters?: ReadonlyArray<CustomEqualityTester>): boolean;
|
||||
buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: any[]): string;
|
||||
}
|
||||
|
||||
|
||||
@@ -917,10 +917,10 @@ describe("jasmine.any", () => {
|
||||
});
|
||||
|
||||
describe('custom asymmetry', function() {
|
||||
const tester = {
|
||||
asymmetricMatch: (actual: string) => {
|
||||
const tester: jasmine.AsymmetricMatcher<string> = {
|
||||
asymmetricMatch: (actual: string, customTesters) => {
|
||||
const secondValue = actual.split(',')[1];
|
||||
return secondValue === 'bar';
|
||||
return jasmine.matchersUtil.equals(secondValue, 'bar', customTesters);
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user