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.
Como explique en otros tutoriales el objetivo de los test es probar una funcionalidad y que retorne una respuesta especifica por defecto, en caso contrario indicar que respuesta se esperaba, por ende, en este caso ambos test son fáciles de entender a simple vista, pero la diferencia radica en el conjunto de código que puedes implementar dentro para mejores prácticas, en resumen, si vas a agregar varios test es mejor utilizar “describe” y cuando sea simple “test”.
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
1 comments
avatar

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. 
 

0
0
0.000