Skip to content

Commit cf932f8

Browse files
tleunenmattphillips
authored andcommitted
Fix typings for toContainEntry, toContainEntries, toContainAllEntries and toContainAnyEntries (jest-community#184)
1 parent 8a5d242 commit cf932f8

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

types/index.d.ts

+15-15
Original file line numberDiff line numberDiff line change
@@ -252,28 +252,28 @@ declare namespace jest {
252252
*
253253
* @param {Array.<String, String>} entry
254254
*/
255-
toContainEntry(entry: [string, string]): R;
255+
toContainEntry<T>(entry: [keyof T, T[keyof T]]): R;
256256

257257
/**
258258
* Use `.toContainEntries` when checking if an object contains all of the provided entries.
259259
*
260-
* @param {Array.<Array.<String, String>>} entries
260+
* @param {Array.<Array.<keyof T, T[keyof T]>>} entries
261261
*/
262-
toContainEntries(entries: [string, string][]): R;
262+
toContainEntries<T>(entries: [keyof T, T[keyof T]][]): R;
263263

264264
/**
265265
* Use `.toContainAllEntries` when checking if an object only contains all of the provided entries.
266266
*
267-
* @param {Array.<Array.<String, String>>} entries
267+
* @param {Array.<Array.<keyof T, T[keyof T]>>} entries
268268
*/
269-
toContainAllEntries(entries: [string, string][]): R;
269+
toContainAllEntries<T>(entries: [keyof T, T[keyof T]][]): R;
270270

271271
/**
272272
* Use `.toContainAnyEntries` when checking if an object contains at least one of the provided entries.
273273
*
274-
* @param {Array.<Array.<String, String>>} entries
274+
* @param {Array.<Array.<keyof T, T[keyof T]>>} entries
275275
*/
276-
toContainAnyEntries(entries: [string, string][]): R;
276+
toContainAnyEntries<T>(entries: [keyof T, T[keyof T]][]): R;
277277

278278
/**
279279
* Use `.toBeExtensible` when checking if an object is extensible.
@@ -606,30 +606,30 @@ declare namespace jest {
606606
/**
607607
* Use `.toContainEntry` when checking if an object contains the provided entry.
608608
*
609-
* @param {Array.<String, String>} entry
609+
* @param {Array.<[keyof T, T[keyof T]>} entry
610610
*/
611-
toContainEntry(entry: [string, string]): any;
611+
toContainEntry<T>(entry: [keyof T, T[keyof T]]): any;
612612

613613
/**
614614
* Use `.toContainEntries` when checking if an object contains all of the provided entries.
615615
*
616-
* @param {Array.<Array.<String, String>>} entries
616+
* @param {Array.<Array.<keyof T, T[keyof T]>>} entries
617617
*/
618-
toContainEntries(entries: [string, string][]): any;
618+
toContainEntries<T>(entries: [keyof T, T[keyof T]][]): any;
619619

620620
/**
621621
* Use `.toContainAllEntries` when checking if an object only contains all of the provided entries.
622622
*
623-
* @param {Array.<Array.<String, String>>} entries
623+
* @param {Array.<Array.<keyof T, T[keyof T]>>} entries
624624
*/
625-
toContainAllEntries(entries: [string, string][]): any;
625+
toContainAllEntries<T>(entries: [keyof T, T[keyof T]][]): any;
626626

627627
/**
628628
* Use `.toContainAnyEntries` when checking if an object contains at least one of the provided entries.
629629
*
630-
* @param {Array.<Array.<String, String>>} entries
630+
* @param {Array.<Array.<keyof T, T[keyof T]>>} entries
631631
*/
632-
toContainAnyEntries(entries: [string, string][]): any;
632+
toContainAnyEntries<T>(entries: [keyof T, T[keyof T]][]): any;
633633

634634
/**
635635
* Use `.toBeExtensible` when checking if an object is extensible.

0 commit comments

Comments
 (0)