Book Image

Learning Aurelia

By : Manuel Guilbault
Book Image

Learning Aurelia

By: Manuel Guilbault

Overview of this book

<p>Aurelia is one of the most promising new JavaScript frameworks for mobile, desktop, and web, which makes developing powerful, modern web applications a straightforward task. Its power lies in its simplicity and clear workflow that enables developers to build next-generations apps for the web with ease.</p> <p>From initial structuring to full deployment, this book will serve as a step-by-step guide to develop a modern web application from scratch with the Aurelia framework. In addition to including a comprehensive coverage of various Aurelia framework features, this book will also show you how to utilize these features in the real world to develop a professional single-page web application. You’ll see how to make the most out of Aurelia by understanding the Aurelia workflow and then applying it in real-world development tasks. By the end of the book, you will have learned to develop a clean and maintainable application in Aurelia from scratch.</p>
Table of Contents (20 chapters)
Learning Aurelia
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Running tasks


The JSPM skeleton comes with a pretty complete set of Gulp tasks. These tasks can be found in the build/tasks directory.

The first thing you'll probably want to do is to run the sample application from the skeleton. This can be done by opening a console in the project directory and running the following command:

> gulp watch

This command launches a development web server with a watcher process which will refresh the browser every time a source file changes.

If you want to run the application without watching the files and automatically refreshing the browser, you can do it by running the serve task:

> gulp serve

Running unit tests

By default, the JSPM skeleton's unit tests can be found in the test/unit directory. It also typically contains three different Gulp tasks related to unit tests:

  • test: Runs the unit tests once

  • tdd: Runs the unit tests once, then watches the files and reruns the tests when the code changes

  • cover: Runs the unit tests once with code coverage enabled using Istanbul (https://github.com/gotwarlost/istanbul)

For example, if you want to do some test-driven development and have your tests run continuously while you code, you can run the following command:

> gulp tdd

Since the skeleton relies on Karma to run the tests, you need to install the Karma CLI on your environment before running any of the tasks above:

> npm install -g karma-cli

Running end-to-end tests

The JSPM skeleton also contains an e2e task, which will launch the end-to-end tests found in the test/e2e/src directory.

However, since the end-to-end tests rely on Protractor, you first need to update the Selenium drivers by running the proper task:

> gulp webdriver-update

Then, since the E2E tests need to interact with the application itself, you need to launch the application:

> gulp serve

Finally, you can open a second console and launch the E2E tests:

> gulp e2e