Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
WEB APP TESTING USING KNOCKOUT.JS

You're reading from   WEB APP TESTING USING KNOCKOUT.JS Design, implement, and maintain a fully tested JavaScript web application using Knockout.JS

Arrow left icon
Product type Paperback
Published in Nov 2014
Publisher
ISBN-13 9781783982844
Length 154 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Roberto Messora Roberto Messora
Author Profile Icon Roberto Messora
Roberto Messora
Arrow right icon
View More author details
Toc

Suites and specifications


In the previous example, we saw that Jasmine is quite simple to use, even if we decided not to express our tests in a real BDD style. Its working pattern is always defined by a sequence of suites that contains a sequence of specifications, which, in turn, contains one or more expectations.

Suites

The describe Jasmine global function defines a suite that we can describe as a container for a given broad context (or more generally, if we don't want to think in BDD, a logical specifications grouping):

describe("a suite or context for specifications", function () {
  //a sequence of specifications
});

The describe function accepts two arguments: a string representing a sentence that expresses the suite/context and a function that contains all the code needed to execute the suite itself, mostly specifications.

It's also possible to nest in the suites calling one or more describe functions inside a parent describe function. This is useful when you have to narrow a big context...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime