Unclear documentation about Enzyme Jest and Mocha
pashute opened this issue · 0 comments
The docs are currently written for someone familiar with jest mocha and Enzyme.
- Perhaps add at the beginning:
Specs
is an addon toStorybook
.
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 withdescribes
andit
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 onJest
which is a built-in testing framework that comes with react-native.Specs
replaces some of the Jest functionality.
- 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 withreact-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.)
-
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. -
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.