Created
March 14, 2023 12:51
-
-
Save akshayjai1/a97a1c924a4095344ad359b3706ec4b9 to your computer and use it in GitHub Desktop.
Testing exports from library
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
import { | |
Button, | |
ButtonProps, | |
BrandComponent, | |
BrandComponentProps, | |
Typography, | |
TypographyProps, | |
} from './index' | |
describe('Component exports', () => { | |
it('exports a Button component', () => { | |
expect(Button).toBeDefined() | |
expect(typeof Button).toBe('function') | |
}) | |
it('exports a ButtonProps type', () => { | |
type Props = ButtonProps | |
const props: Props = { | |
onClick: () => {}, | |
} | |
expect(props).toBeDefined() | |
}) | |
it('exports a BrandComponent component', () => { | |
expect(BrandComponent).toBeDefined() | |
expect(typeof BrandComponent).toBe('function') | |
}) | |
it('exports a BrandComponentProps type', () => { | |
type Props = BrandComponentProps | |
const props: Props = { | |
variant: 'stacked', | |
} | |
expect(props).toBeDefined() | |
}) | |
it('exports a Typography component', () => { | |
expect(Typography).toBeDefined() | |
expect(typeof Typography).toBe('function') | |
}) | |
it('exports a TypographyProps type', () => { | |
type Props = TypographyProps | |
const props: Props = { | |
variant: 'h1', | |
} | |
expect(props).toBeDefined() | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment