Diferencia entre test y describe en Jest ['ESP','ENG']
En el mundo de los test con javascript hay diferentes maneras de ejecutar los test para ver que respuestas obtenemos en el código ya sea de manera sencilla u probar varias porciones de código a la vez.
Para mostrar la diferencia utilizare código sencillo y fácil de explicar.
In the world of testing with javascript there are different ways to run tests to see what answers we get in the code, either in a simple way or testing several portions of code at the same time. To show the difference I will use simple and easy to explain code.
![](https://images.hive.blog/DQmTEYqZURTiU6kAit6DoibrxbB6DH5BnY6EHXZGJXMwfr4/testear.jpg)
As I explained in other tutorials, the objective of the tests is to test a functionality and return a specific response by default, otherwise indicate what response was expected, therefore, in this case both tests are easy to understand at a glance, but the The difference lies in the set of code that you can implement within for best practices. In short, if you are going to add several tests it is better to use “describe” and when it is simple “test”.
0
0
0.000
Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!
Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).
You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support.