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

Unclear documentation about Enzyme Jest and Mocha #100

Open
pashute opened this issue Jun 20, 2018 · 0 comments
Open

Unclear documentation about Enzyme Jest and Mocha #100

pashute opened this issue Jun 20, 2018 · 0 comments

Comments

@pashute
Copy link

pashute commented Jun 20, 2018

The docs are currently written for someone familiar with jest mocha and Enzyme.

  1. Perhaps add at the beginning:

Specs is an addon to Storybook.
Storybook allows the developer during development to visually see a component or part of it, and interactively see immediate changes to the code. It also helps document the project with visual examples.
Specs adds the ability to write stories with describes and it so that the story becomes a specification and can then be tested along with testing frameworks and tools. Specs without anything else looks like this:

an example with no test just verbose specs

and can be then tested. Specs uses and relies on Jest which is a built-in testing framework that comes with react-native. Specs replaces some of the Jest functionality.

  1. For someone like me not familiar with Jest or Enzyme,
    2.1 it is not clear if Enzyme is required or is an example of usage,
    2.2 and if the part about Jest and its configuration is a second and separate example or is a continuation of the required configuration for the first example,
    2.3 and it is not clear if there it can be run with Jest without Enzyme.
    2.4 It is not clear what "expect" that is being imported with Enzyme in the example exactly is. Is this part of Jest that is built in with react-native? If not please give a link to what it is. If yes, please state that.
    2.5 It is not clear which parts of the code are Jest, which Enzyme and which Specs, so add a // remark on the side of each specification.

If indeed there are two examples, one running without Jest and the second without Enzyme, perhaps write that.

a. An example using Enzyme and expect (expect is part of Jest and comes built-in with react-native).
b. An example using only Jest.

(According to your answers here I can propose a markdown and if acceptable, will make a pull request.)

  1. I know this a Jest question, but if you depend on Jest that the users need to know: Is Jest built-in with projects created by react-native init too, or only in projects started with CRNA (Create React Native Apps). That information too should be in the readme.

  2. Same questions with Mocha. Is this a third option to use specs? Or are you proposing a typical usage that includes Jest. If so, please state that:

Another typical usage of the Specs addon would be with Mocha which adds the ability to create data and component mockups. In this example we use Jest.

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

No branches or pull requests

1 participant