Book Image

Learning JavaScriptMVC

By : Wojciech Bednarski
Book Image

Learning JavaScriptMVC

By: Wojciech Bednarski

Overview of this book

<p>JavaScriptMVC is a client-side, JavaScript framework that builds maintainable, error-free, lightweight applications as quickly as possible. As it does not depend on server components, it can be combined with any web service interface and server-side language.<br /><br />"Learning JavaScriptMVC" will guide you through all the framework aspects and show you how to build small- to mid-size well-structured and documented client-side applications you will love to work on.<br /><br />This book starts from JavaScriptMVC installation and all its components are explained with practical examples. It finishes with an example of building a web application. You will learn what the JavaScriptMVC framework is, how to install it, and how to use it efficiently.<br /><br />This book will guide you on how to build a sample application from scratch, test its codebase using unit testing, as well as test the whole application using functional testing, document it, and deploy the same. After reading Learning JavaScriptMVC you will learn how to install the framework and create a well-structured, documented and maintainable client-side application.</p>
Table of Contents (13 chapters)

Running tests


There are quite few ways to run tests. Using a web browser, a command-line tool will open the web browser and close it after the test execution is completed. We can also run tests using standalone JavaScript environments.

Web browser

Disable the pop-up blocker and open tests/todo_test.html in the browser. The test will open the Todo application and run the test case against it. After this, you should be able to see something similar to the following screenshot:

Selenium

Run the following command from the Todo app directory:

$ ./js funcunit/run selenium todo/tests/todo_test.html

This command will open Firefox, run exactly the same test as in the web browser example, close the browser, and print the results on a command line.

PhantomJS

A much faster solution is running test using PhantomJS, because it doesn't launch the web browser.

Execute following command to run the test:

$ ./js funcunit/run phantomjs todo/tests/todo_test.html

The preceding command will run the test in a PhantomJS environment...