Skip to content

Commit

Permalink
fix: merge extended matchers with the global namespace (#9)
Browse files Browse the repository at this point in the history
Closes #7
  • Loading branch information
marnusw authored and bcarroll22 committed Jul 15, 2019
1 parent 96b5d38 commit 2925c0a
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions extend-expect.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { ReactTestInstance } from 'react-test-renderer';

declare namespace jest {
interface Matchers<R> {
toBeDisabled(): R;
toContainElement(element: ReactTestInstance | null): R;
toBeEmpty(): R;
toHaveProp(attr: string, value?: any): R;
toHaveTextContent(text: string | RegExp, options?: { normalizeWhitespace: boolean }): R;
toBeEnabled(): R;
toHaveStyle(style: object[] | object): R;
declare global {
namespace jest {
interface Matchers<R> {
toBeDisabled(): R;
toContainElement(element: ReactTestInstance | null): R;
toBeEmpty(): R;
toHaveProp(attr: string, value?: any): R;
toHaveTextContent(text: string | RegExp, options?: { normalizeWhitespace: boolean }): R;
toBeEnabled(): R;
toHaveStyle(style: object[] | object): R;
}
}
}

0 comments on commit 2925c0a

Please sign in to comment.