Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test the typings by trying to render a simple component server-side #1181

Closed
wants to merge 1 commit into from

Conversation

dennari
Copy link
Contributor

@dennari dennari commented Jan 18, 2017

As it stands, the typings seem to break quite easily in new releases. This PR adds a smoke test that tries to render a simple component server-side with typescript. It's run in Circle after the normal test set.

@levithomason
Copy link
Member

levithomason commented Jan 20, 2017

Thanks for the PR, we should certainly have some kind of tests around ts. I cannot see any obvious reason that the Icon export is importing as undefined however.

@levithomason
Copy link
Member

levithomason commented Jan 26, 2017

Is there some way to write this as a loop so that all directories are tested for consistency? We very much favor abstracted automated tests when possible.

Here we test all doc site examples to ensure they render without errors. It is an easy win smoke test across the board to ensure the initial render is at least successful.

Another example is the isConformant common test for all components. It ensures the component is properly setup in the library and has base functionality. Would be great to have something similar for ts. Potential automated assertions:

  • assert every component directory has an index.d.ts
  • assert that it exports a component of the same name as the folder
  • assert that it exports a subcomponent for every other js file in the directory
  • assert that it can render the default export

You can see examples of how we use configurable commonTests in any test file, like Button-test.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants