-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Jest matchers utils (#1464)
* feat: add formatMessage * feat: add TS extends * chore: remove old Jest Native tests
- Loading branch information
1 parent
8987414
commit 4a8072d
Showing
6 changed files
with
49 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { TextMatch, TextMatchOptions } from '../matches'; | ||
|
||
export interface JestNativeMatchers<R> { | ||
toBeOnTheScreen(): R; | ||
toHaveTextContent(text: TextMatch, options?: TextMatchOptions): R; | ||
} | ||
|
||
// Implicit Jest global `expect`. | ||
declare global { | ||
namespace jest { | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
interface Matchers<R, T = {}> extends JestNativeMatchers<R> {} | ||
} | ||
} | ||
|
||
// Explicit `@jest/globals` `expect` matchers. | ||
declare module '@jest/expect' { | ||
interface Matchers<R extends void | Promise<void>> | ||
extends JestNativeMatchers<R> {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters