Common front-end components for Web using the Tesseract design system, written for React. https://make.modal.sh/tesseract/web/react/common
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

15 lines
294 B

  1. import ReactIs from 'react-is'
  2. declare global {
  3. namespace jest {
  4. interface Matchers<R> {
  5. toBeComponent(): R,
  6. }
  7. }
  8. }
  9. export const toBeComponent = (received: any) => ({
  10. message: () => `expected ${received} to be a component`,
  11. pass: ReactIs.isValidElementType(received),
  12. })