Organizing Jasmine specs into groups and subgroups

Whenever code expands and becomes complex, we can segregate and categorize the Jasmine specs corresponding to a specific feature or component. In this recipe, you will learn how to organize Jasmine specs into groups and subgroups. Jasmine provides the describe global function to define group-related specs. The string parameter of the describe function is used to name the collection of specs, which represents a specific feature or component. This helps in finding specs and corresponding JavaScript code in a large suite. The name of the collection of specs is further concatenated with the name(s) of subgroup(s) to make a spec's full name. Moreover, if we name them well, we can read specs as a full ...

Get Jasmine Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.