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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.