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

MVVM and unit testing


When we decide to use a presentation pattern as the most important pillar of a software solution, we are also establishing a specific direction to follow in developing the application.

We need to understand that if we decide to adopt Knockout.JS, it is because it grants us some important concrete advantages, not because we have to simply choose one of the many JavaScript frameworks out there.

In Chapter 2, The Knockout.JS UI Framework Explained, we talked about one of the advantages: a clear separation between the user interface and presentation logic. Why is this a real benefit? There are several possible answers, but if we want to remain in the unit testing context, we can apply proper unit testing specifications to the presentation logic, independent from the user interface.

In MVVM, the ViewModel is a pure-code representation of the View. The View itself is (must remain) a thin and simple layer, whose job is to present the data and receive the user interaction. This...

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 €18.99/month. Cancel anytime