I tried to find the differences between describe and context. but I'm confused a little bit. So anyone can clarify the difference and the use cases for each one of them.
Also when i should write nested describe in my test case?
Thanks
I tried to find the differences between describe and context. but I'm confused a little bit. So anyone can clarify the difference and the use cases for each one of them.
Also when i should write nested describe in my test case?
Thanks
Copyright © 2021 Jogjafile Inc.
If you examine the source code of Quick, there is no difference between them. You can nest describes and context however you please and everything will work fine. These functions are mostly tools for you to structure your code in a way that makes sense. For instance you could end up with something like:
There aren't any hard-set rules about when or how to use describe and context or when to nest them and in which order. I would recommend to nest and use them in a way that make your tests as easy to read and understand as possible.