Skip to content

Commit

Permalink
Fix typescript for toBeDateString and toBeHexadecimal (jest-community…
Browse files Browse the repository at this point in the history
  • Loading branch information
David Harkness committed Nov 13, 2021
1 parent 157215b commit 29eeca3
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,14 @@ declare namespace jest {
toBeFunction(): R;

/**
* Use `.toBeDateString` when checking if a value is a valid date string.
*
* @param {String} string
*/
toBeDateString(string: string): R;
* Use `.toBeDateString` when checking if a value is a valid date string.
*/
toBeDateString(): R;

/**
* Use `.toBeHexadecimal` when checking if a value is a valid HTML hex color.
*
* @param {String} string
*/
toBeHexadecimal(string: string): R;
toBeHexadecimal(): R;

/**
* Use `.toHaveBeenCalledBefore` when checking if a `Mock` was called before another `Mock`.
Expand Down Expand Up @@ -418,7 +414,7 @@ declare namespace jest {
}

// noinspection JSUnusedGlobalSymbols
interface Expect {
interface AsymmetricMatchers {
/**
* Note: Currently unimplemented
* Passing assertion
Expand Down Expand Up @@ -541,18 +537,14 @@ declare namespace jest {
toBeFunction(): any;

/**
* Use `.toBeDateString` when checking if a value is a valid date string.
*
* @param {String} string
*/
toBeDateString(string: string): any;
* Use `.toBeDateString` when checking if a value is a valid date string.
*/
toBeDateString(): any;

/**
* Use `.toBeHexadecimal` when checking if a value is a valid HTML hex color.
*
* @param {String} string
*/
toBeHexadecimal(string: string): any;
toBeHexadecimal(): any;

/**
* Use `.toHaveBeenCalledBefore` when checking if a `Mock` was called before another `Mock`.
Expand Down Expand Up @@ -826,4 +818,10 @@ declare namespace jest {
*/
toEqualIgnoringWhitespace(string: string): any;
}

// noinspection JSUnusedGlobalSymbols
interface Expect extends AsymmetricMatchers {}

// noinspection JSUnusedGlobalSymbols
interface InverseAsymmetricMatchers extends AsymmetricMatchers {}
}

0 comments on commit 29eeca3

Please sign in to comment.